UBB.Dev
Posted By: swebs wrapping dynamic content - 06/09/2008 6:25 AM
I just upgraded to 7.2. I use to use the old wrapper which was pretty simple for me. I just created a php file that had a little board stuff at the top to call/include all the necessary functions/files and then I could do all my own PHP stuff and all the users board info was accessible to my scripts. then output what I wanted and then include the board footer.

All the info my script produced was shown in the middle section of the boards. This way I could use the boards authentication to do different things in my scripts. Display.. not display..

I see now after the upgrade that the wrapper does not seem to work the same..

Is there a new upgraded wrapper or do I have to dig in and learn smarty and convert all my dynamic content over.

Here is what I do.

1. User hit a custom page. (list of students/classes)
2. I use to check if the user was registered and what groups they had access to.
3. Based on the group access I could display specific data only. This involved getting their id checking their group and then reading from another mysql db.
4. Then based on all that I would output the page and it would look like it was part of the boards because of the wrapper.

Any suggests would be great, cause this smarty stuff is a bit confusing.
Posted By: swebs Re: wrapping dynamic content - 06/09/2008 6:37 AM
If anyone has an example of accessing another database and displaying content based on the group that the user belongs to on the boards, that would be awesome.
Posted By: blaaskaak Re: wrapping dynamic content - 06/09/2008 11:36 AM
What I do have is a script that uses ubb sort of as the CMS.

If you call it, it shows a certain post as your webpage inside the ubb wrapper.

You could add code to that script to authentica whether or not to show it, and what post to show.
Posted By: swebs Re: wrapping dynamic content - 06/10/2008 12:38 AM
I would appreciate it if you could send me the script to [email protected]

I have to believe someone out there has done something like this.

check the users group if it is in a certain group.
Open/get all the rows from another database table. Sort/display it based on what the user has access to.

Posted By: swebs Re: wrapping dynamic content - 06/10/2008 12:40 AM
Maybe I'm asking the wrong question.

In the script.inc file what is the variable that shows:
User Name
User Login
User Group

Then how do I pass a table of data (html) to be displayed in the template.inc
Posted By: AllenAyres Re: wrapping dynamic content - 06/10/2008 5:25 AM
What did you upgrade from? The current wrapper posted should work for all 7.x .threads installs. If you are wanting something a bit more involved Ian Spence released a ubb.auth script - should be in the mods forum.
Posted By: swebs Re: wrapping dynamic content - 06/10/2008 8:11 AM
I upgraded from a 6.x version.

Maybe I'm missing it. I looked all through there. Can someone provide a LINK to this ubb.auth code?
Posted By: blaaskaak Re: wrapping dynamic content - 06/10/2008 9:49 AM
For me, the easiest is to just write everything inside the ubb framework. The authentication is done for me, and everything that has to be displayed is done for me.

Look at /scripts/sample.inc.php for an example on how to do this.
Posted By: swebs Re: wrapping dynamic content - 06/10/2008 8:12 PM
I see the sample.inc but its a bit confusing for me.

Is there a doc somewhere that shows all the variables that are accessible to me. Like $User.Group for $Username $login anything like that?

Also, once I create all the text to be displayed how do I pass that to the template to display? Put it all into some variable and then put {$display} in the template file?

This is why the last wrapper was a bit easier for me. It was just a file that did all the authentication and then I just needed to include(header) and include(footer).

I'm sure the new way is better I just need to get this figured out.
Posted By: AllenAyres Re: wrapping dynamic content - 06/11/2008 6:51 AM
Once you get the sample.inc.php file setup and the sample.tpl template mentioned (in the variables at the bottom of sample.inc.php) you just call ubbthreads.php/ubb/sample and the page automagically loads for you.
Posted By: AllenAyres Re: wrapping dynamic content - 06/11/2008 6:53 AM
Oh, and check the topic stickied in the mod forum for "generic page outside the forum" or something like it - a little more complete explanation of how to run something like you want is in there.
© UBB.Developers