PDA

View Full Version : Help


vietkieu_cz
07 Jan 2006, 17:02
Help me with Creating Custon Sub-Pages.
I've asked here but nobody answered me.(http://www.vbulletin.org/forum/showthread.php?goto=lastpost&t=98009)
I want to create a sub-custom page -
I read here but did not understand
Creating "Subpages"

If you want to create "subpages" within your custom page, simply wrap blocks of code with the following structure:




Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Where do I add Php Code?
How I create subpages in AdminCP (Templates)?
Get the Link to Subpages? ...test.php?page=2 ???

harmor19
08 Jan 2006, 03:13
let's say you named your script "test.php"



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

vietkieu_cz
25 Jan 2006, 14:22
Thanks harmor19
Now I want to add custom template
e.x.:
in my template test_mytesttemplate1, there I add $customtemp
then i add a new temp. called customtemp
now what I have to add in my test.php script?

harmor19
25 Jan 2006, 15:30
Use
eval('$customtemp = "' . fetch_template('customtemp') . '";');

Place this in the same subpage where the template where you would like the html of "customtemp" to be.

In this case you want to place the new template function in this section.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



It doesn't matter where you put it but I would suggest above the existing fetch_template function.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I'll explain how a fetch_template function with a variable works.

[COLOR=Red]eval('$customtemp = "' . fetch_template('customtemp') . '";');

The "$customtemp" variable is what you put in another template file.

So in the "test_mytesttemplate1" template you should have the variable "$customtemp".

The text in side the "fetch_template" function (which is "customtemp") is the template it's getting the html from.

vietkieu_cz
30 Jan 2006, 11:55
thank you harmor again :)

I need a code for my custom page, which connects to phpmyadmin and gets the term of a post (e.x. id of post 1)
can you help me?

- sorry for my bad english
thanks