vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   How do I code this right? (https://vborg.vbsupport.ru/showthread.php?t=1862)

07-18-2000 06:16 AM

In my forumdisplay.php I want to be able to display a separate link dependent on the forum they are reading at the time.

This is what I have:

if ($forumid==4) {
$ForumNews = "<IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"/rules/$forumid.html\"><B><smallfont Color=Red>Posting Guidelines for the Software For Sale Forum</B></A><BR><IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"http://www.xchangecity.com/\"><B>Exchange your used DVDs and CDs here!</smallfont></B></A><BR><IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<B><largefont color=red><U>NO AUCTIONS! ALL SALE ITEMS MUST HAVE A POSTED PRICE</U></largefont></B>";
}
elseif ($forumid==5) {
$ForumNews = "<IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"/rules/$forumid.html\"><B><smallfont color=red>Posting Guidelines for the Hardware For Sale Forum</smallfont></B></A><BR><IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"http://www.wildin.com/addatrade.asp\"><B><largefont Color=Red Size="3"><U>NO AUCTIONS! ALL SALE ITEMS MUST HAVE A POSTED PRICE</U></largefont></B></A>";
} else {
$ForumNews = "";
}

This keeps giving me a parsing error.

Any ideas as to what would be causing the error?

Thanks,
Parker

07-18-2000 10:45 AM

Quote:

Originally posted by Parker Clack
if ($forumid==4) {
$ForumNews = "<IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"/rules/$forumid.html\"><B><smallfont Color=Red>Posting Guidelines for the Software For Sale Forum</B></A><BR><IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"http://www.xchangecity.com/\"><B>Exchange your used DVDs and CDs here!</smallfont></B></A><BR><IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<B><largefont color=red><U>NO AUCTIONS! ALL SALE ITEMS MUST HAVE A POSTED PRICE</U></largefont></B>";
}
elseif ($forumid==5) {
$ForumNews = "<IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"/rules/$forumid.html\"><B><smallfont color=red>Posting Guidelines for the Hardware For Sale Forum</smallfont></B></A><BR><IMG SRC=\"/icons/icon4.gif\" height=15 width=15 border=0>&nbsp;&nbsp;<A HREF=\"http://www.wildin.com/addatrade.asp\"><B><largefont Color=Red Size="3"><U>NO AUCTIONS! ALL SALE ITEMS MUST HAVE A POSTED PRICE</U></largefont></B></A>";
} else {
$ForumNews = "";
}
Should be Size=\"3\" :)

07-18-2000 10:49 AM

hi,

I have added some '\' before the '"'s. You forget them some times. Try the following code. If it doesn?t work, I give you an alternative way to display different links.

Code:

if ($forumid==4) {
$ForumNews = "<IMG SRC=\"/icons/icon4.gif\" height=15
width=15 border=0>??<A HREF=\"/rules/
$forumid.html\"><B><FONT SIZE="1" FACE="verdana,arial,helvetica" Color=Red>Posting Guidelines
 for the Software For Sale Forum</B></A><BR><IMG
SRC=\"/icons/icon4.gif\" height=15 width=15
border=0>??<A HREF=\"http://www.xchangecity.com/
\"><B>Exchange your used DVDs and CDs here!
</font></B></A><BR><IMG SRC=\"/icons/icon4.gif\"
height=15 width=15 border=0>??<B><b><FONT face="Arial, Helvetica" color ="#003399" size="3"
color=red><U>NO AUCTIONS! ALL SALE ITEMS MUST HAVE A POSTED
 PRICE</U></b></font></B>";

}
elseif ($forumid==5) {
$ForumNews = "<IMG SRC=\"/icons/icon4.gif\" height=15
width=15 border=0>??<A HREF=\"/rules/
$forumid.html\"><B><FONT SIZE="1" FACE="verdana,arial,helvetica" color=red>Posting Guidelines
for the Hardware For Sale Forum</font></B></A><BR><IMG
SRC=\"/icons/icon4.gif\" height=15 width=15
border=0>??<A
HREF=\"http://www.wildin.com/addatrade.asp\"><B><b><FONT face="Arial, Helvetica" color ="#003399" size="3"
Color=Red Size=\"3\"><U>NO AUCTIONS! ALL SALE ITEMS MUST
HAVE A POSTED PRICE</U></b></font></B></A>";

} else {
$ForumNews = "";
}

Greetings, Daniel


[Edited by Daniel on 07-18-2000 at 07:50 AM]

07-18-2000 10:57 AM

or else use a ' instead of a " : $string = "<font size='2'>your string</font>";

Some sort of qq function/operator (like in perl) would be usefull in php btw

07-18-2000 01:22 PM

Thanks for all the suggestions. I just needed the \"3\"
as suggested. Forgot about that.

I agree that some sort of qq function in PHP would be nice.

Parker


All times are GMT. The time now is 06:19 PM.

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.01003 seconds
  • Memory Usage 1,730KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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