vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Can anyone help me out with this php mod that I cant get right? (https://vborg.vbsupport.ru/showthread.php?t=168667)

siggen 01-24-2008 08:15 PM

Can anyone help me out with this php mod that I cant get right?
 
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...

Quote:


################################################## ##############################
############################### 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...

Quote:

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


All times are GMT. The time now is 10:47 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00938 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete