PDA

View Full Version : [help] How 2 Show Template I Created Automatically


Come2Daddy
03-25-2009, 05:28 PM
Hello every one,

Actually I tried to make an HTML table, & I succeeded :D
so I paste the table code at the end of the header, and it shows wonderfull
but I want it to be extractable so I can distribute it as a plugin/product alone,

hence I created a new template, as I called this template: my_template

then I created a plugin, & choosed the hook location to be: parse_template

this plugin contains this fragment of code:

eval('$my_template = "' . fetch_template('my_template') . '";');

but my template didn't appeare, I added this variable at the end of the header: $my_template
but still didn't work.


So can any one help me by telling me, how to let this template be shown???

Come2Daddy
03-26-2009, 08:58 PM
up
up

Seven Skins
03-26-2009, 09:06 PM
eval('$my_template .= "' . fetch_template("my_template") . '";');

Come2Daddy
03-26-2009, 09:49 PM
Thanx, Seven Skins, but it didn't work, besides I never saw this syntax in any working hack

I never saw the DOT b4 the EQUALE SIGN

...y_template .= "' . fetch_te...

I even have no idea what have u meant with this code

TigerC10
03-26-2009, 10:14 PM
The = operator assigns content. the .= operator appends content. In other words, the $my_template variable already exists and is displaying - so you just add to it. This requires that you use an existing variable that is already in use somewhere.


If you don't want to do it that way, you can try doing this instead:

eval('print_output("' . fetch_template($template_name) . '");');


However, doing it that way will most likely not print the way you expect it to.

Seven Skins
03-26-2009, 11:01 PM
Try adding a hook at: global_start or if you just want that table on your forumhome then forumhome_start

With your original code:
eval('$temp = "' . fetch_template('temp') . '";');

.

TigerC10
03-26-2009, 11:25 PM
But that still won't output the template for view. They'd have to manually edit a template and throw the $temp variable in there.

Dismounted
03-27-2009, 05:30 AM
If you just want to spit the template...
eval('print_output("' . fetch_template('temp') . '");');

Come2Daddy
04-09-2009, 10:45 PM
actually nothing's worked, so I tried to create it again from the scratch, and it works, so I don't know where was my mistake, yet
but finally solved it :)

thank u all, for helping my