Follow vBSEO on Twitter
vBulletin Modifications
  • Forums
  • Add-Ons
  • Template Modifications
  • Styles
  • Graphics
  • Tutorials
  • Support Center
  • Register
  • vBulletin SEO

Member Log In

Site Navigation

  • Register
  • Members List
  • Social Groups
  • Search
  • Today's Posts
  • Mark Forums Read

Latest Modifications

  • [vB 3.8.4] THX - Hack for VB. 3.8.4
    By: bluedog
  • [vB 3.8.4] Cyb - Chatbox V.2.3
    By: bluedog
  • [vB 4.0.x] PHPKD - Advanced Quick...
    By: PHPKD
  • [vB 3.6.x] StopSpam
    By: flappi282
  • [vB 3.8.x] vBulletin Chat Addon for...
    By: 123flashchat

Latest Template Mods

  • [vB 4.0.x] Remove My Profile Link...
    By: Ak Worm
  • [vB 3.8.x] Images DownloadBox...
    By: cRs!MP
  • [vB 3.8.x] Adviertise Mod On Forum...
    By: MG4
  • [vB 3.8.4] Images PassWordBox...
    By: cRs!MP
  • [vB 3.8.4] Footer Follow Ups
    By: Ak Worm

Latest Styles

  • [vB 4.0.x] 4.0.3 - VB4STYLE-TWEETA...
    By: Belon
  • [vB 4.0.x] [4.0.3] vbdesigns.de...
    By: Belon
  • [vB 3.8.4] CompletevB - Skylight
    By: DreadKnight
  • [vB 3.8.3] [vB 3.8.4] Barcelona...
    By: hoiquantinhoc.com
  • [vB 3.8.3] Natures Walk by vBSkin...
    By: Chri5

Latest Graphics

  • [vB ] [anim.]Team Ranks
    By: cRs!MP
  • [vB ] Abstract Circles (3...
    By: cRs!MP
  • [vB ] PlayStation Rank Images
    By: cRs!MP
  • [vB 3.6.12] Heavy Stroked Button...
    By: Shelley
  • [vB ] Minature Ranks.
    By: Shelley
vBulletin Modifications » General vBulletin Section » vBulletin Modification Requests » bbcode parse nfo files as png
Reply

 

  • Thread Tools
Old 07-13-2004, 06:15 PM   #1
tokenyank
Coder

Activity Longevity
0/20 19/20
Today Posts
0/3 sssssss20
tokenyank is on a distinguished road
Status: Offline bbcode parse nfo files as png
Is there a way to convert a phpbb hack to a vB hack? phpbb has a hack that if you use [ nfo] bbcode, it'll take the info and auto-parse it to a png like you see on nforce.

The problem is, I don't know nearly enough about php to do the conversion and I'm hoping someone else does! :D

Here is the code for the phpBB hack:
PHP Code:
# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/bbcode.php 

# 
#-----[ FIND ]--------------------------------------------- 
# 
   // [code] and [/code] for posting code (HTML, PHP, C etc etc) in your posts. 
   
$text = bbencode_second_pass_code($text, $uid, $bbcode_tpl); 

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
   // [NFO] and [/NFO] 
   
$text = bbencode_second_pass_nfo($text, $uid, $bbcode_tpl); 

# 
#-----[ FIND ]--------------------------------------------- 
# 
   // [code] and [/code] for posting code (HTML, PHP, C etc etc) in your posts. 
   
$text = bbencode_first_pass_pda($text, $uid, '[code]', '[/code]', '', true, ''); 
# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
   // [NFO] and [/NFO] 
   
$text = bbencode_first_pass_pda($text, $uid, '[nfo]', '[/nfo]', '', true, ''); 

# 
#-----[ FIND ]--------------------------------------------- 
# 
   // Now, do all the non-first-level matches. These are simple. 
   
$text = str_replace("[code:$uid]", $code_start_html, $text); 
   
$text = str_replace("[/code:$uid]", $code_end_html, $text); 

   return 
$text; 

} 
// bbencode_second_pass_code() 

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
function bbencode_second_pass_nfo($text, $uid, $bbcode_tpl) 
{ 
   global 
$lang; 

   
$code_start_html = $bbcode_tpl['nfo_open']; 
   
$code_end_html =  $bbcode_tpl['nfo_close']; 

   
$match_count = preg_match_all("#\[nfo:1:$uid\](.*?)\[/nfo:1:$uid\]#si", $text, $matches); 

   for (
$i = 0; $i < $match_count; $i++) 
   { 
      
$before_replace = $matches[1][$i]; 
      
$after_replace = $matches[1][$i]; 
      
$after_replace = str_replace("  ", "  ", $after_replace); 
      
$after_replace = str_replace("  ", "  ", $after_replace); 
      
$after_replace = str_replace("\t", "   ", $after_replace); 
      
$str_to_match = "[nfo:1:$uid]" . $before_replace . "[/nfo:1:$uid]"; 
      
$replacement = $code_start_html; 
      
$replacement .= $after_replace; 
      
$replacement .= $code_end_html; 
      
$text = str_replace($str_to_match, $replacement, $text); 
   } 

   
$text = str_replace("[nfo:$uid]", $code_start_html, $text); 
   
$text = str_replace("[/nfo:$uid]", $code_end_html, $text); 

   return 
$text; 

} 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
{in your template directory}/bbcode.tpl 

# 
#-----[ FIND ]--------------------------------------------- 
# 
<!-- BEGIN code_open --></span> 
<
table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"> 
<
tr> 
     <
td><span class="genmed"><b>{L_CODE}:</b></span></td> 
   </
tr> 
   <
tr> 
     <
td class="code"><!-- END code_open --> 
     <!-- 
BEGIN code_close --></td> 
   </
tr> 
</
table> 
<
span class="postbody"><!-- END code_close --> 

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
<!-- BEGIN nfo_open --></span> 
<
table width="500" cellspacing="1" cellpadding="3" border="0" align="center"> 
<
tr> 
     <
td><span class="genmed"><b>NFO:</b></span></td> 
   </
tr> 
   <
tr> 
     <
td class="nfo"><!-- END nfo_open --> 
     <!-- 
BEGIN nfo_close --></td> 
   </
tr> 
</
table> 
<
span class="postbody"><!-- END nfo_close --> 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
{in your template directory}/posting_body.tpl 

# 
#-----[ FIND ]--------------------------------------------- 
# 
f_help = "{L_BBCODE_F_HELP}"; 
x_help = "{L_BBCODE_X_HELP}"; 
y_help = "{L_BBCODE_Y_HELP}"; 

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
n_help = "NFO: [nfo]text[/nfo] (alt+n)"; 

# 
#-----[ FIND ]--------------------------------------------- 
# 
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); 

# 
#-----[ REPLACE WITH ]--------------------------------- 
# NOTE: Clareful with this one if you have other bbcode mods installed 
# 
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url],'[nfo]','[/nfo]'); 

# 
#-----[ FIND ]--------------------------------------------- 
# 
         <td><span class="genmed"> 
           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('
w')" /> 
           </span></td> 
# 
#-----[ AFTER, ADD ]-------------------------------------- 
# NOTE: If you have additional bbcode mods installed you will need to increase the addbbcodeXX accordingly 
# 
         <td><span class="genmed"> 
           <input type="button" class="button" accesskey="n" name="addbbcode18" value="NFO" style="text-decoration: underline; width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('
n')" /> 
           </span></td> 

# 
#-----[ FIND ]--------------------------------------------- 
# 
         <select name="addbbcode18" onChange="bbfontstyle('
[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')"> 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# NOTE: If you have additional bbcode mods installed you will need to increase the addbbcodeXX accordingly 
# 
         <select name="addbbcode20" onChange="bbfontstyle('
[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')"> 

# 
#-----[ FIND ]--------------------------------------------- 
# 
         </select>  {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('
[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# NOTE: If you have additional bbcode mods installed you will need to increase the addbbcodeXX accordingly 
# 
         </select>  {L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('
[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f)"> 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
{in your template directory}/{template}.css 

# 
#-----[ FIND ]--------------------------------------------- 
# 
/* Quote & Code blocks */ 

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
.nfo   { 
color: #000000; 
font-weight: normal; 
font-size: 11px; 
font-family: Terminal; 
background-color: #CCCCCC; 
border: solid 1px #666666 } 

# 
#-----[ SAVE, CLOSE, UPLOAD ALL FILES ]-------------------------------------- 
# 
And, here is a phpclass to change ASCII to PNG:
/http://php.emaginedev.biz/browse/package/1618.html




If this can be done, that'd be fantastic... No more boring posts of crappy text! It'd be like damn.nfo viewers installed with vB! :D

Thanks and looking forward to seeing if this can be done.
Reply With Quote
Old 07-16-2004, 08:51 PM   #2
tokenyank
Coder

Activity Longevity
0/20 19/20
Today Posts
0/3 sssssss20
tokenyank is on a distinguished road
Status: Offline Default
xxxxxxxxxxxxxxxxxx

Last edited by tokenyank; 06-15-2006 at 09:14 PM.
Reply With Quote
Old 07-19-2004, 07:49 PM   #3
TouchingVirus
Coder

Activity Longevity
0/20 20/20
Today Posts
0/3 ssssss105
TouchingVirus is on a distinguished road
Status: Offline Default
why png it? ...just use the terminal font to display it in plaintext!
Reply With Quote
Old 07-19-2004, 07:56 PM   #4
Repec
Coder

Activity Longevity
0/20 20/20
Today Posts
0/3 ssssss105
Location: Holland
Repec is on a distinguished road
Send a message via ICQ to Repec
Status: Offline Default
doesnt work quite right if u just use terminal font
Reply With Quote
Old 07-19-2004, 10:55 PM   #5
tokenyank
Coder

Activity Longevity
0/20 19/20
Today Posts
0/3 sssssss20
tokenyank is on a distinguished road
Status: Offline Default
xxxxxxxxxxxxxxxxxxxxxxxxxxx

Last edited by tokenyank; 06-15-2006 at 09:13 PM.
Reply With Quote
Old 07-19-2004, 11:21 PM   #6
Repec
Coder

Activity Longevity
0/20 20/20
Today Posts
0/3 ssssss105
Location: Holland
Repec is on a distinguished road
Send a message via ICQ to Repec
Status: Offline Default
Quote:
Originally Posted by quickening
Terminal font would be good if I wanted it to parse like notepad, but I've seen this hack for phpBB and the ASCII renders into a pretty .png... So, why would you drive a Ford when you could have a Ferrari? :D
this is an nfo in terminal font, imo it looks way better then the stuff nforce has for example.

And besides why add 20 million lines of code extra if u can do it with 2 lines of code
Attached Images
File Type: png expanded.png (15.7 KB, 145 views)
Reply With Quote
Old 07-22-2004, 11:50 AM   #7
TouchingVirus
Coder

Activity Longevity
0/20 20/20
Today Posts
0/3 ssssss105
TouchingVirus is on a distinguished road
Status: Offline Default
Looks good repec..or should i say Mr 2 <br/> :D

Anyways, what repec said was true, the code it would take would be a performance hit and i personally think the terminal version is nicer..and its also easier to copy because it isnt an image!
Reply With Quote
Old 07-22-2004, 04:39 PM   #8
Repec
Coder

Activity Longevity
0/20 20/20
Today Posts
0/3 ssssss105
Location: Holland
Repec is on a distinguished road
Send a message via ICQ to Repec
Status: Offline Default
Quote:
Originally Posted by TouchingVirus
Looks good repec..or should i say Mr 2 <br/> :D
Who in his right mind would use an nl2br in his code lol. Stupid if u ask me :p
Reply With Quote
Old 03-16-2005, 01:19 AM   #9
ShavedApe
Coder

Activity Longevity
0/20 20/20
Today Posts
0/3 sssss1112
Location: UK
Age: 37
ShavedApe is on a distinguished road
Status: Offline Default
terminal doesnt work in all browsers and thats the reason for using png or finding a decent alternative.
Reply With Quote

Reply

« User Credits to see/reply to threads | PM to staff only »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Rules



All times are GMT. The time now is 06:28 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Transverse Styles
  • Top
  • Archive
  • vBSEO
  • Contact Us
LinkBack
LinkBack URL LinkBack URL
About LinkBacks About LinkBacks
Bookmark & Share
Digg this Thread! Digg this Thread!
Add Thread to del.icio.us Add Thread to del.icio.us
Bookmark in Technorati Bookmark in Technorati
Furl this Thread! Furl this Thread!