Log in

View Full Version : Can anyone help me out with this php mod that I cant get right?


siggen
01-24-2008, 08:15 PM
I'm really a newbie, and this was the first time I've ever tried to mod anything, and as expected, I couldn't get it to work.

I opened the thread.php in wordpad, searced up the "$poll", and found it right under the "show poll" embedded in xxx'es

Then wrote it like this...



################################################## ##############################
############################### SHOW POLL ######################################
################################################## ##############################
<h2>$thread[title]</h2>
<div id="h2stats">denne traden har $thread[replycount] svar og har blitt vist $thread[views] ganger</div>
h2
{
font-size: 200%;
text-align: center;
margin: 0;
padding: 0;
}
#h2stats
{
font-size: 125%;
text-align: center;
}
$poll = '';



I translated the text to Norwegian, as my forum is going to be in Norwegian.

I then copied the whole modified file into the showthread.php file on my forum server, saved it, and tried to open a post on my forum...

I'm using the 3-6-8_Patch_Level_2 version

As expected, I got an error message...


Parse error: syntax error, unexpected '<' in /home/xxxx*/public_html/forum/showthread.php on line 589


*= I removed this name, naturally...

I then put the original file back in without the mods, and my threads showed up as before...

What did I do wrong?

Did I put the mod in at the wrong place?

Can anyone please help me???

The original mod is to be found here...

https://vborg.vbsupport.ru/showthread.php?t=99504

Really hope someone could help me out here...


.

Eikinskjaldi
01-24-2008, 08:38 PM
vbulletin uses a templating system, which means the actual html lives in a template (in the db), and vb uses a substitution system whereby variables in the template are replaced by values. You can see where these templates are used by finding lines like fetch_template(foo) or eval(fetch_template(foo))

in the db there might be a template called whee which contains
<h1>$bar</h1>

an example script.php might contain
$bar = 7
eval(fetch_template('whee'))

In short you need to find the poll template and mod that, not the code.

cheesegrits
01-24-2008, 10:01 PM
A useful little feature for working out what text is in which template is to enable the "Add Template Name in HTML Comments" option under vB's General Settings. You can then view the page source in your browser, and see exactly where every template starts and ends.

-- hugh