Previous Thread
Next Thread
Print Thread
Rate Thread
#240791 03/16/2003 9:42 AM
Joined: Oct 2000
Posts: 9
Newbie
Newbie
Offline
Joined: Oct 2000
Posts: 9
sorry , I'm not good talk English .
I my question :
Where find This The color code [PHP] example in vbulletin forum ?
look The picture in Attachment .
Attachments
73262-aaaa.jpg (0 Bytes, 18 downloads)

Sponsored Links
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I do not quite understand what your asking. Alot of people here do not use vbulletin here.

The specific query you have highlighted gets the Board title and number from the w3t_Boards database and puts it in an array. Perhaps if you explain what you are trying to do more I can understand what your asking?

Joined: Jul 2002
Posts: 3
Lurker
Lurker
Offline
Joined: Jul 2002
Posts: 3
My friends ...

alotiabi in his post wants a hack which coloring the PHP code inserted inside the post like what done in VBulletin forums...

Joined: Oct 2000
Posts: 9
Newbie
Newbie
Offline
Joined: Oct 2000
Posts: 9
I'm searching the hack to be able to make any available text cam be displayed in a colourful way when we put it between two codes
PHP Code
 and  
As one used in vbulletin forums .

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I am pretty sure there is no such hack, and it does not sound like an easy one, so I will move this to Modification Suggestions.

Sponsored Links
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Actually, it shouldnt be that hard....

http://www.php.net/manual/en/function.highlight-string.php

If you read you'll see a snippet about this very thing.

Last edited by extremebikini; 03/17/2003 4:56 PM.
Joined: Oct 2000
Posts: 9
Newbie
Newbie
Offline
Joined: Oct 2000
Posts: 9
look to the function .
it may be useful :

Code
<br /><br /><?<br />function phphighlite($code) {<br /><br />		if (!strpos($code,"<?") and substr($code,0,2)!="<?") {<br />			$code="<?\n".trim($code)."\n?>";<br /><br />		}<br />echo "<ol><li>";<br />		ob_start();<br />		$oldlevel=error_reporting(0);<br />		highlight_string($code);<br />		error_reporting($oldlevel);<br />		$buffer = ob_get_contents();<br />		ob_end_clean();<br />echo ereg_replace( "<br />" , "</li><li>" , $buffer );<br />echo "</li></ol>";<br />		if ($addedtags) {<br />		  $openingpos = strpos($buffer,'&lt;?');<br />		  $closingpos = strrpos($buffer, '?');<br />		  $buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);<br /><br />		$buffer = str_replace("&quot;", "\"", $buffer);<br />  }<br /><br />  return ;<br />}<br /><br />$buffer="<HTML><br /><HEAD><br /><TITLE></TITLE><br />   <META name=description content=><br /><META name=keywords content=><br /> <META name=generator content=><br />    </HEAD><br /><BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#0000FF VLINK=#800080><br /><!--Don't forget to add your FREE HitBOX statistics to your web page. To<br />do so, click on Online Services\HitBox Statistics...--><br /><br /></BODY><br /></HTML>";<br />echo phphighlite($buffer);<br />?><br /><br />

Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Where does $addedtags come from (I dont see it assigned anywhere)? This looks close; but I would suspect you have a little more work to do.

Plus there is the issue of grabbing any code between [php] tags and ocnverting them (assuming there might be more than one).


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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
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)