PDA

View Full Version : How can i use my own $template variable?


HyperActiv
03-12-2009, 04:08 PM
Hello everyone,

can someone teach me how can i integrate a template with another template?
like FORUMHOME template, in the end of it there is a $footer and it shows the footer template in the home page of the board.

RLShare
03-12-2009, 04:53 PM
To add custom templates you would need to write a plugin or edit the files so that it grabs the data from the database about your template and stores it in a variable such as '$footer' and then edit the template you want the data to show up in and place the variable wherever you want the data to be displayed.

HyperActiv
03-12-2009, 04:57 PM
Im not really how to do what you did, can some one please writh an article about it?

Im asking it because i wanna add credit to modifcation i build, and i wanna publish it, how can i code an very hard removal credit? like vBCredit does?

I used template hook, but its very easy to know where is the hook in the plugins and remove it, does somebuddy have an idea?

by the way- sorry for my very bad english.

RLShare
03-12-2009, 05:10 PM
Most credits systems are not actually hard to remove, they are usually just a plugin that inserts it into a template with a call to str_replace.

HyperActiv
03-12-2009, 05:11 PM
Most credits systems are not actually hard to remove, they are usually just a plugin that inserts it into a template with a call to str_replace.

can you please give me an example code to str_replace?

--------------- Added 1236911056 at 1236911056 ---------------

Ok thanks for the help, i've learned how to do what i wanted to do.

what i was meant is something like this:

$text = " this is the text that will be shown in the board after you added the $text in your template ";

but now i have another question:

if i want to put a MD5 hash, how can i do that it will shows the text [output of the hash] and no the hash himself.

for example:

$credit = " 54b258dae2756c5b3be4530c2959148c ";
^this will be in the plugin/php file

and in the board himself, the client side will see the word "vbulletin"
how can i do that?

Thanks for the helpers.

Dismounted
03-14-2009, 04:09 AM
Output of a hash? The whole point of a hash is that it is one-way...

RLShare
03-14-2009, 04:22 AM
What your looking for is something like base64_encode() and base64decode()

But personally, I will never use a modification that does such a thing and really no other user should either. You can use those methods to hide malicious code.

Dismounted
03-14-2009, 05:11 AM
Also note that no encoded/encrypted code in any modifications are allowed on vB.org. (Minified JS is OK.)