vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Embed PHP in Templates (https://vborg.vbsupport.ru/showthread.php?t=52775)

Tae-Hwan 09-27-2003 07:32 PM

filburt, in your opinion does this render logician's conditionals hack obsolete? i'm fluent in php. i liked logician's conditionals a lot except that it was kinda slow..

drives fast 09-29-2003 01:12 AM

I have tried many combinations and haven't figured out this one yet

if someone would be so kind

this is what I had figured out in the vb3 conditionals:
PHP Code:

<if condition="$post[usergroupid]==11"><font color="#ffcc00" face="verdana, arial, helvetica" size="1"><b>Site Supporter</b></font> <img src="/forum/eimages/supporter.gif" width="11" height="11" border="0" /></if> 

how can that be modified to work within the <? ?> in the earlier vbulletin version that I have installed this hack in?

I have tried several things but only get parse errors displayed above the header

stuff like:
PHP Code:

<?
if (condition = $post[usergroupid]==11) {
$var = "<font color=\"#ffcc00\" face=\"verdana, arial, helvetica\" size=\"1\"><b>Site Supporter</b></font> <img src=\"/forum/eimages/supporter.gif\" width=\"11\" height=\"11\" border=\"0\" />"
}
?>

and:
PHP Code:

<?
if ($post[usergroupid] != 11) {
$var = "<smallfontcolor='#ffcc00'><b>Site Supporter</b></smallfont> <img src='/forum/eimages/supporter.gif' width='11' height='11' border='0' />"
}
?>

I know it is just because I don't know the language to use

thanks a bunch for any help

drives fast 10-02-2003 04:18 AM

once again...I couldn't get bit by a dog even with a steak hanging around my neck

Tae-Hwan 10-17-2003 08:10 PM

Quote:

Originally Posted by drives fast
once again...I couldn't get bit by a dog even with a steak hanging around my neck

hehe, i never heard that one before...

well, i don't have any experience in vbulletin 3, but if i'm understanding the code correctly, it should look something like this in php:

PHP Code:

<? 
if ($post[usergroupid]==11) { 
echo "<font color=\"#ffcc00\" face=\"verdana, arial, helvetica\" size=\"1\"><b>Site Supporter</b></font><img src=\"/forum/eimages/supporter.gif\" width=\"11\" height=\"11\" border=\"0\">";

?>


drives fast 10-18-2003 01:20 AM

thank you...I will give that a try.

it looks like it will work though....I forgot about the "echo"

gmarik 10-19-2003 03:06 PM

We all forget some times about the quotes or the echo ...

stephenv 11-13-2003 08:19 PM

I read through some of the other messages AFTER modifying/fixing the original script, I would have added the <?php ?> <php> </php> stuff but I can't be arsed. On a deadline for other stuff.

That said, attached is an updated version that uses output buffering (in case you want to echo text) and also fixes the str_replace that didn't do squat :)



Mail me at stephen AT natnet DOT com if you want to say thanks or have questions, today was my first day on the board and I probably won't be back (fixed for a client who wanted to use phpAdsNew).

NuclioN 12-08-2003 09:04 AM

Very usefull! I hope this will possible in vb3 soon. :)

spittingangels 01-14-2004 01:35 AM

Quote:

Originally Posted by stephenv
I read through some of the other messages AFTER modifying/fixing the original script, I would have added the <?php ?> <php> </php> stuff but I can't be arsed. On a deadline for other stuff.

That said, attached is an updated version that uses output buffering (in case you want to echo text) and also fixes the str_replace that didn't do squat :)

Mail me at stephen AT natnet DOT com if you want to say thanks or have questions, today was my first day on the board and I probably won't be back (fixed for a client who wanted to use phpAdsNew).


With these modifications, the hack works like a charm for what I needed it to do, which was to pull a php file into the header template via include(). the original hack would pull the file into the page but only at the top of the page and not where it was supposed to display.

For everyone else that had a similar problem, try this version. My thanks to both authors that worked on this.


All times are GMT. The time now is 12:19 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.01239 seconds
  • Memory Usage 1,744KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete