Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
how?
I know i cant use straight html, because that gives parse errors.
I'd like to use the customboxpal's to display a few adverts with my sidebar mod. ButI dont know how to code it!
Also, the menupal, the links dont work, how can i amend them? I looked at the code but cant figure it out.

Sponsored Links
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
well just enclose the html in a echo " <insert html here>"; and any quotes " in the html code just escape out by preceding them with a \

se post https://www.ubbdev.com/forum/showflat...5/o/all/fpart/1

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
You can use HTML in a palbox, scroungr wrote up a great example of how to do it Here even though this example is used for javascript its the same prinicipal, just make sure there is a backslash before all special characters in the link and it will parse out properly.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
LOL.. jinx scroungr, you owe me a coke

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
thanks guys!

Sponsored Links
Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
$TempStorage .= echo"<a onclick="javascript:window.open('http://www.ultimatetopsites.com/bin/topsite.cgi?ford&cat=kewl&ID=152');" href="javascript:void(0);">Click Here to Vote for MEG!</a>";


can you spot why this isnt working? i get a parse error.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Try this

echo "<a onclick="javascript:window.open('http://www.ultimatetopsites.com/bin/topsite.cgi?ford&cat=kewl&ID=152');" href="javascript:void(0);">Click Here to Vote for MEG!</a>";

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
just to double check i've understood correctly

[]
// Check and see if we need update cache
if ((!$LastCacheTime) || (!$CustomBox2Data) || ($LastCacheTime < ($date - ($custombox2cache * 60)))) {
$TempStorage = "";// Leave this blank and add to the string all
// information that is to be displayed in the box

echo "<a onclick="javascript:window.open('http://www.ultimatetopsites.com/bin/topsite.cgi?ford&cat=kewl&ID=152');" href="javascript:void(0);">Click Here to Vote for MEG!</a>";



";

/*
Write what ever functions and routines you want and have them store all information
into the above string for storage to the cache string. The information will be echoed
out to the browser at the end of this script.
*/

[/]

it still doesnt work
got a parse error on a different line now, line 52 which is this
[]echo "$tbopen<tr><td align="left" class="tdheader">"; // Table Start
[/]

Joined: Jan 2003
Posts: 125
Journeyman
Journeyman
Joined: Jan 2003
Posts: 125
we've added in phpmyadsnew on our sidebox, it works very well for serving up and tracking banners, you should check it out.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
here try this

echo "<a onclick="javascript:window.open('http://www.ultimatetopsites.com/bin/topsite.cgi?ford&cat=kewl&ID=152','_blank');" href="javascript:void(0);">Click Here to Vote for MEG!</a>";

Sponsored Links
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
thats all one line so make sure to put it on one line.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, there's an extra

";

Several lines below - that shouldn't be there.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I also sent him a PM with the entire code that I used when I tested it in my palbox. Sorry, I should have posted that up right when I sent it.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
no big deal heh

Joined: Jun 2002
Posts: 303
Enthusiast
Enthusiast
Joined: Jun 2002
Posts: 303
You can use html without any escaping! Just come out of php with ?> put your html in then go back to php with <?

Simple. That's the beauty of php!

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
true Fish Thats probably the most unconfusing for newbies also.

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
ahhh, i didnt realise i can come out of php, might play with that in the future.
I've got phpadsnew running on my server, that could be handy actually!

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
You can also escape out of the php this way instead

echo <<<template

HTML HERE

template;


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)