Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 02-19-2005, 01:55 AM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default help with vb nfo reader script to work on vbulletin file system plz

hello i need a little help here i have a nfo viewer hack for vbulletin what this hack dose is it makes a viewable nfo file in vb all the user dose is uploads a nfo file then it shows on vb ...

ok heres my problem the script is made to work with the data base and all but my vb 3.0.6.
Attachments are currently being stored in the filesystem of vb i need this hack to work on the file system can some one help me plz here is the code:

PHP Code:

 
Open showthread
.phplook for this :

// load attachments
    
if ($thread['attach'])
    {
        
$attachments $DB_site->query("
            SELECT filename, filesize, visible, attachmentid, counter, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize
  

and replace with :

// load attachments
    if (
$thread['attach'])
    {
           
$attachments = $DB_site->query("
            
SELECT  filename,filedatafilesizevisibleattachmentidcounterpostid, IF(thumbnail ''01) AS hasthumbnailLENGTH(thumbnail) AS thumbnailsize
  

Then look 
for this 

while (
$attachment $DB_site->fetch_array($attachments))
        {


and 
replace with :

while (
$attachment $DB_site->fetch_array($attachments))
        {
  
$s1 '';
  if (
ereg('.nfo',$attachment[filename]))
    {

 
$s1.="<table id='shownfo' class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" width=\"100%\" border=\"0\">\n";
$s1.="<thead><tr><td class=\"tcat\" colspan=\"2\" width=\"100%\"><a href=\"#top\" style=\"float:right\" ";
$s1 .= " onclick=\"return toggle_collapse('shownfo')\">";
$coll =  "collapseimg_shownfo" ;
$s1.= "<img id=\"collapseimg_shownfo\" src='".$stylevar[imgdir_button]."/collapse_alt".str_replace('_collapsed','',$vbcollapse[$coll]).".gif' alt=\"\" border=\"0\">";
$s1.="</a><strong><a href=\"#top\" onclick=\"return toggle_collapse('shownfo')\">ShowMe'NFO: ".$attachment[filename]."   </a></strong></td></tr></thead>\n";
$s1.="<tbody id=\"collapseobj_shownfo\" style=\"\"><tr><td class=\"alt1\" >" ;
$s1.= "<img src=\"nfos/".str_replace('.nfo','.png',$attachment[filename] )."\">";

     
// Load the NFO file...
        
$lines explode("\n",$attachment[filedata] );


        
// Get the longest line....
        
$longestLine 0;
        
$numberLines 0;

        foreach (
$lines as $line_num => $line)
        {
            
$line rtrim($line);

            
$tempLineLength strlen($line);        // Avoid calling strlen twice...
            
if( $tempLineLength $longestLine )
                
$longestLine $tempLineLength;
        }


        
// The number of line....
        
$numberLines count($lines);


        
//Set up the Vars...
        
$fontWidth  8;
        
$fontHeight 12;

        
$border 1;    // Not one pixel, but 1*FontWidth and 1*FontHeight

        
$imgWidth   = ($fontWidth $longestLine)   + ( $border $fontWidth );
        
$imgHeight  = ($fontHeight $numberLines)  + ( $border $fontHeight );


        
$currentX   $border $fontWidth;
        
$currentY   $border $fontHeight;


        
// Start GD
       
$img        imagecreatetruecolor$imgWidth$imgHeight );
        
$charMap    imagecreatefrompng("charmap-20-255.png");


        
// Main loop....
        
foreach ($lines as $line_num => $line)
        {
            
// Avoid calling strlen strlen($line) times :-)
            
$currentLineLength strlen($line);
            for( 
$i 0$i $currentLineLength$i++ )
            {
                
// Get the Locatino of the char in the charmap image
                
$charYOffSet 0;
                
$charXOffSet ord($line[$i]) - 20;        // Becuase my charmap skips the first 20 chars :-)

                
while( $charXOffSet >= 20 )
                {
                    
$charYOffSet++;
                    
$charXOffSet $charXOffSet 20;
                }

                
// int imagecopy ( resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h)
                
imagecopy$img$charMap$currentX$currentY, ($fontWidth $charXOffSet), ($fontHeight $charYOffSet), $fontWidth$fontHeight );

                
// Move along one char to the right
                
$currentX $currentX $fontWidth;
            }

            
// Move down a line, and reset the x location
            
$currentX = ($border $fontWidth);
            
$currentY $currentY $fontHeight;
        }


        
imagepng$img,"nfos/".str_replace('.nfo','.png',$attachment[filename] ));
        
imagedestroy($img);

     
$s1.= "</td></tr></tbody>\n</table>\n";
     
$s1.="<script type='text/javascript'> toggle_collapse('shownfo');</script>";
$attachment[nfo] = $s1;
}



Modifications 

Edit postbit_attachmentlook for this :

td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
    <
td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]target="_blank">$attachment[filename]</a> ($attachment[filesize], <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase>)</td>
  </
tr>
  


and 
replace with :

<
td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
    <
td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]target="_blank">$attachment[filename]</a><br> ($attachment[filesize], <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase>)
</
td>
</
tr>
<
tr><td>  </td><td>
<
br>
$attachment[nfo]
</
td>
</
tr
i just need help for it to work on vb file system plase help me help
  #2  
Old 02-19-2005, 03:01 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A .nfo is used by Windows System Information tools. Why do you need to view them?
  #3  
Old 02-19-2005, 03:24 AM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

these are not the nfo files im talking about !

can this code be fixed ?

here are a few images
Attached Images
File Type: png screen1.png (6.7 KB, 0 views)
File Type: png screen2.png (14.2 KB, 0 views)
  #4  
Old 02-19-2005, 06:38 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most nfo's on the internet are basically text files, but that's getting more into warez.
  #5  
Old 02-21-2005, 04:43 AM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can some one please help with the code please
  #6  
Old 02-21-2005, 02:04 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not only is there no legitimate need to read .nfo files that are not used as registered by default on Windows, but the screenshots you provided also include a known piracy group. Jelsoft will not tolerate piracy or the use of vBulletin to fester piracy.
Closed Thread


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

Forum Jump


All times are GMT. The time now is 10:09 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.05028 seconds
  • Memory Usage 2,296KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete