MyBB Community Forums

Full Version: adding a dynamic page with mybb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
ive tried using this one
http://community.mybboard.net/showthread.php?tid=6615
but my php codes wont execute.

is there any other way that i could include my php page within a template and be able to perform queries to database and other php functions.

also... i was trying to get the uid of the current user login, i thought it was using session.

what variable should i call to get the cookie value of the userid?

need it so much to perform queries from other custom db tables.



thanks
edge18 Wrote:ive tried using this one
http://community.mybboard.net/showthread.php?tid=6615
but my php codes wont execute.
Can you say what the errors are? I've updated the code in the first post (I think correctly) to 1.2.x specs. Please check that out

edge18 Wrote:is there any other way that i could include my php page within a template and be able to perform queries to database and other php functions.

also... i was trying to get the uid of the current user login, i thought it was using session.

what variable should i call to get the cookie value of the userid?
{$mybb->user['uid']}
there was actually no errors

i tried the code... i inserted a small php code that would echo "1234"
inside the template.... but all it displays is the html codes... the <?php echo "1234;?> wasn't executed at all

also


i was looking for something like $_SESSION['uid'], is it like this one $_COOKIE['uid']; if so is uid the correct one?

sorry Smile php newbie here

im trying to get the current userid in the cookie of the user logged in so that i could use it as a criteria when querying from the database


thanks a lot sir
edge18 Wrote:inside the template.... but all it displays is the html codes... the <?php echo "1234;?> wasn't executed at all

The code is wrong. You're missing a " between the 4 and ;
oops wrong typo... i got it on the code itself still aint working....

shouldn't it return an error or something if i forgot to close the string with "


edit___


tried it one more time... still the <?php echo "1234"; ?> did not execute...
You can't run php commands in the template.
aw. Sad is there any other way that i could query from a database without using a separate page in an iframe?

i was planning to put up a a profile,photos and blog page for each user... somewhat like myspace but more simpler like each user has his own gallery of photos.

hmmm.. should i write my own plugin?

any reference for creating plugins for mybb?

help much appreciated sir...
[Wiki: Plugins] (Broken link, head over to docs.mybb.com instead) - That should help you out.

Cheers
thanks a lot sir....

last thing sir
all my php commands will go within this ryt?

function pluginname_activate()
{
}

are there any limitations in php here?

Smile thanks Tikitiki
edge18 Wrote:thanks a lot sir....

last thing sir
all my php commands will go within this ryt?

function pluginname_activate()
{
}

are there any limitations in php here?

Smile thanks Tikitiki

No you must make your own function, and then find a hook to call that function. the _activate and _deactivate functions just run when you click "Activate" and "Deactivate respectively in the Admin CP Plugin Manager.

[Wiki: Authoring_Plugins] (Broken link, head over to docs.mybb.com instead) should give you a little bit more insight.
Pages: 1 2