SitePoint Sponsor

User Tag List

Results 1 to 21 of 21

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help With Linkman PHP Script

    So i downloaded linkman and i was having trouble embedding it into my site design well im finally getting the links.php file looking good. The page is pulling up a lot of errors in css validator. Heres what im talking about http://jigsaw.w3.org/css-validator/v...rning=&lang=en http://validator.w3.org/check?uri=ht...Inline&group=0

    Heres the source to home.php

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <title>Kratom | Kratom Leaf |</title>
      <meta name="description"
     content="uKratom offers information on kratom, kratom powder, kratom leaf, kratom extracts, effects of kratom, where to buy kratom and more.">
      <meta name="abstract"
     content="Get information about kratom, kratom extracts, kratom effects, kratom dosage and more. Learn all you can about the wounderful kratom plant.">
      <meta name="ROBOTS" content="ALL=INDEX,FOLLOW">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <link rel="stylesheet" type="text/css"
     href="http://ukratom.com/styles.css">
      <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-30392963-1']);
    _gaq.push(['_trackPageview']);
    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
      </script>
      <style type="text/css">
    p.c3 {text-align: center;}
    img.c2 {border: 0px solid ; width: 200px; height: 106px;}
    img.c1 {border: 0px solid ; width: 450px; height: 89px;}
      </style>
    </head>
    <body>
    <div id="container">
    <div id="header">
    <h1><a href="http://ukratom.com" title="kratom home"><img class="c1"
     src="http://ukratom.com/images/kraton_logo.jpg" alt="Kratom"></a><a
     href="http://www.bouncingbearbotanicals.com/ethnobotanicals-kratom-c-60_91.html?ref=4331"
     target="_blank"><img class="c2" alt="buy kratom, kratom buy"
     src="http://ukratom.com/images/Kratom_leaf.jpg"></a></h1>
    </div>
    <div id="wrapper">
    <div id="content"><?php include("links.php");?>
    </div>
    </div>
    <div id="navigation">
    <ul>
      <li><a href="kratom_images.html" title="kratom images">Kratom
    Images</a></li>
      <li><a href="kratom_dosage.html" title="kratom dosage">Kratom
    Dosage</a></li>
      <li><a href="kratom_effects.html" title="kratom effects">Kratom
    Effects</a></li>
      <li><a href="kratom_extracts.html" title="kratom extract">Kratom
    Extracts</a></li>
      <li><a href="kratom_resin.html" title="kratom resin">Kratom
    Resin</a></li>
      <li><a href="kratom_crushed.html" title="crushed kratom leaf">Crushed
    Kratom Leaf</a></li>
      <li><a href="kratom_powder.html" title="kratom powder">Kratom
    Powder</a></li>
    </ul>
    </div>
    <div id="extra">
    <p class="c3"><a href="http://ukratom.com/" title="kratom home">Kratom
    Home</a>
    | <a href="sitemap.html" title="kratom sitemap">Site
    Map</a></p>
    </div>
    <div id="footer">
    <p class="white">&copy;
    uKRATOM.COM</p>
    </div>
    </div>
    </body>
    </html>
    Heres The link.php code
    Code:
    <?php
    /*******************************************************************************
    *  Title: LinkMan reciprocal link manager
    *  Version: 1.7 @ April 18, 2009
    *  Author: Klemen Stirn
    *  Website: http://www.phpjunkyard.com
    ********************************************************************************
    *  COPYRIGHT NOTICE
    *  Copyright 2004-2009 Klemen Stirn. All Rights Reserved.
    *
    *  This script may be used and modified free of charge by anyone
    *  AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
    *  By using this code you agree to indemnify Klemen Stirn from any
    *  liability that might arise from it's use.
    *
    *  Selling the code for this program, in part or full, without prior
    *  written consent is expressly forbidden. Using this code, in part or full,
    *  to create competing scripts or products is expressly forbidden.
    *
    *  Obtain permission before redistributing this software over the Internet
    *  or in any other medium. In all cases copyright and header must remain
    *  intact. This Copyright is in full effect in any country that has
    *  International Trade Agreements with the United States of America or
    *  with the European Union.
    *
    *  Removing any of the copyright notices without purchasing a license
    *  is illegal! To remove PHPJunkyard copyright notice you must purchase a
    *  license for this script. For more information on how to obtain a license
    *  please visit the site below:
    *  http://www.phpjunkyard.com/copyright-removal.php
    *******************************************************************************/
    
    define('IN_SCRIPT',1);
    require('settings.php');
    
    
    if ($settings['show_form'])
    {
    	?>
    	<p><a href="#addlink">Submit your website</a></p>
    	<?php
    }
    
    $lines = file($settings['linkfile']);
    
    /* Handle pages */
    if ($settings['allow_pages'])
    {
    	/* Page number, default 1st page */
    	$page=intval($_REQUEST['page']);
    	if ($page > 0)
    	{
    	    $start=($page*$settings['max_per_page'])-$settings['max_per_page'];$end=$start+$settings['max_per_page']-1;
    	}
    	else
    	{
    	    $page=1;$start=0;$end=$settings['max_per_page']-1;
    	}
    
        /* Total number of links */
    	$total = count($lines);
    
    	if ($total > 0)
        {
    	    if ($end > $total) {$end=$total;}
    	    $pages = ceil($total/$settings['max_per_page']);
                   
    	    $page_nav = '';
    
    	    if ($pages > 1)
    	    {
            	$page_nav = '<p>';
    
    	        $prev_page = ($page-1 <= 0) ? 0 : $page-1;
    	        $next_page = ($page+1 > $pages) ? 0 : $page+1;
    
    	        if ($prev_page)
    	        {
    	        	$page_nav .= '<a href="links.php?page=1">&lt;&lt; First</a> &nbsp;|&nbsp; ';
                	if ($prev_page > 1)
                    {
                    	$page_nav .= '<a href="links.php?page='.$prev_page.'">&lt; Prev</a> &nbsp;|&nbsp;';
                    }
    	        }
    
    	        for ($i=1; $i<=$pages; $i++)
    	        {
    	            if ($i <= ($page+5) && $i >= ($page-5))
    	            {
    	               if($i == $page) {$page_nav .= ' <b>'.$i.'</b> ';}
    	               else {$page_nav .= ' <a href="links.php?page='.$i.'">'.$i.'</a> ';}
    	            }
    	        }
    
    	        if ($next_page)
    	        {
                    if ($next_page < $pages)
                    {
                        $page_nav .= ' &nbsp;|&nbsp; <a href="links.php?page='.$next_page.'">Next &gt;</a>';
                    }
                    $page_nav .= ' &nbsp;|&nbsp; <a href="links.php?page='.$pages.'">Last &gt;&gt;</a>';
    	        }
    
                $page_nav .= '</p>';
    
                echo $page_nav;
    	    }
    	}
        $lines = array_slice($lines,$start,$settings['max_per_page']);
    }
    
    $print_featured = 0;
    $first = 1;
    $i = 0;
    
    foreach ($lines as $thisline)
    {
        $thisline=trim($thisline);
        if (!empty($thisline))
        {
            $i++;
            list($name,$email,$title,$url,$recurl,$description,$featured,$pr)=explode($settings['delimiter'],$thisline);
    
            $show_url = $settings['show_url'] ? '&nbsp;<span class="linkmanURL">-&nbsp;'.$url.'</span>' : '';
    
            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>';
            }
            else
            {
                $pr_code = '';
            }
    
            if ($settings['show_thumbshots'])
            {
                $thumb_code = '<td valign="top" class="linkman"><img src="'.$settings['thumb_url'].rawurlencode($url).'" style="vertical-align: middle;" border="1" width="120" height="90" alt="Thumbnail">&nbsp;</td>';
            }
            else
            {
                $thumb_code = '';
            }
    
            if ($featured == 1)
            {
    
                if ($print_featured == 0)
                {
                    $print_featured = 1;
                    $first = 0;
                    echo '<p class="linkman"><b>Featured links</b></p><table border="0" cellspacing="1" cellpadding="1">';
                }
    
                $url      = ($settings['clean'] != 1) ? $url : 'go.php?url='.rawurlencode($url);
                $nofollow = ($settings['use_nofollow']==1) ? 'rel="nofollow"' : '';
    
                echo '
                <tr>
                '.$thumb_code.'
                '.$pr_code.'
                <td valign="top" class="linkman"><p class="linkman"><a href="'.$url.'" target="_blank" class="linkman" '.$nofollow.'><b>'.$title.'</b></a>'.$show_url.'<br>'.$description.'<br>&nbsp;</p></td>
                </tr>
                ';
            }
            else
            {
                if ($settings['show_thumbshots']!=1)
                {
                    $thumb_code = '';
                }
    
                if ($print_featured == 1)
                {
                    $print_featured = 0;
                    $first = 1;
                    echo '</table>';
                }
    
                if ($first == 1)
                {
                    $first = 0;
                    echo '<p class="linkman"><b>Reciprocal links</b></p><table border="0" cellspacing="1" cellpadding="1">';
                }
    
                $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>
                ';
            }
        }
    }
    
    /* Close the table if at least one link is printed out */
    if ($i)
    {
        echo '</table>';
    
    	/* Print bottom page navigation if at least 20 listings on the page */
    	if ($settings['allow_pages'] && $i > 19)
    	{
        	echo $page_nav;
    	}
    }
    else
    {
        echo '<p class="linkman">No links yet!</p>';
    }
    
    if ($settings['show_form'])
    {
        if ($i < $settings['max_links'])
        {
        ?>
        <p class="linkman"><a name="addlink"></a>&nbsp;<br><b>Submit your website</b></p>
    
        <p><b>&raquo; Step 1: Add our link to your website</b></p>
    
        <table border="0">
        <tr>
        <td>Website URL:</td>
        <td><a href="<?php echo $settings['site_url']; ?>" target="_blank"><?php echo $settings['site_url']; ?></a></td>
        </tr>
        <tr>
        <td>Website Title:</td>
        <td><?php echo htmlspecialchars($settings['site_title']); ?></td>
        </tr>
        <tr>
        <td>Description:</td>
        <td><?php echo htmlspecialchars($settings['site_desc']); ?></td>
        </tr>
        </table>
    
        <p><textarea rows="4" cols="60" onfocus="this.select()">&lt;a href=&quot;<?php echo $settings['site_url']; ?>&quot;&gt;<?php echo htmlspecialchars($settings['site_title']); ?>&lt;/a&gt; - <?php echo htmlspecialchars($settings['site_desc']); ?></textarea></p>
    
        <p><b>&raquo; Step 2: Submit your link</b></p>
    
        <p>All fields are required. Please finish <b>Step 1</b> before submitting this form.
        <?php
        if ($settings['man_approval'])
        {
        	echo ' New links will be approved manually.';
        }
        ?></p>
    
        <form method="post" action="addlink.php">
    
        <table border="0">
        <tr>
        <td><b>Your name:</b></td>
        <td><input type="text" name="name" size="40" maxlength="50"></td>
        </tr>
        <tr>
        <td><b>E-mail:</b></td>
        <td><input type="text" name="email" size="40" maxlength="50"></td>
        </tr>
        <tr>
        <td><b>Website title:</b></td>
        <td><input type="text" name="title" size="40" maxlength="50"></td>
        </tr>
        <tr>
        <td><b>Website URL:</b></td>
        <td><input type="text" name="url" maxlength="255" value="http://" size="40"></td>
        </tr>
        <tr>
        <td><b>URL with reciprocal link:</b></td>
        <td><input type="text" name="recurl" maxlength="255" value="http://" size="40"></td>
        </tr>
        </table>
    
        <p><b>Website description:</b><br>
        <input type="text" name="description" maxlength="200" size="60"></p>
    
        <p><input type="submit" value="Add link"></p>
    
        </form>
        <?php
        } // End if $settings['max_links'] < $i
        else
        {
        ?>
        <p class="linkman">&nbsp;<br /><b>Submit your website</b></p>
    
        <p><i>Unfortunately we are not accepting any new links at the moment.</i></p>
        <?php
        }
    } // End if $settings['show_form']
    
    eval(gzinflate(base64_decode('DdBHsqJAAADQ43x/uRBBUs0KJEiQjA1spiTTZJEG+vQz7wivQO
    /uVOFmKLv3tzil76Vgbn/zIhvz4vQjZbQO50kQBMm9sb5auxVwKZoR4tqVBGLUPnDqFOH+bKbwmeAzvy
    kFB0WF95PyuCTJuCvo0UNhW2VqI/vollGRQZlcK/b9uFlNlX3olZkPt5I4IGebU8fBRJlKNinReNFdUU
    WDh8UuSx6rcuXMRchRbJdYJmBTrH7+NkVCN6wp5Xb+UHWHZS2+zfnEFGX2uzy11T2LRsDExPHxkHkdm/
    M96Awho+mQUkQUUW5VAzdSTTJ8N1SawJgFi7ebBdnmryNvTVDJHKJJQEAcVPEebX5paaP4CcoqhKt0zE
    x5btB51ubuBpajV+n7xH1eFRjbA1MDpOxxBknTOuwT8o/JCmY17B1U1ZCPFHv1vGaZj3ZP9g2sIMMWth
    s22o9sYi2BDQLD1l4y02HtRS4Q1WIxhamsE7Oz4oABkRRHDNfkXO1/8UsdPP5A3P9F6UuSM7/znWKrjQ
    yHRFYJRuGkNh5aIr4/r2tuFCyV6+Fu3z7G2z961xH8mX5oCcmWg+m4GkWE1724EKnTNhv2oaqf6StWVe
    DhWApeYoHUJTD6lLkgNk3Z9HL5+f39/fMP')));
    ?>
    Beyond that Ill need to do the same thing with other php pages in the script like for example if you click the "add link" button without putting any data it will pull up an error page. Maybe i should also do the same with that? Im not sure it at least has a previous page link...

    Im ok with css and html but I know nothing about php.
    Last edited by Mittineague; Apr 5, 2012 at 23:06. Reason: fixing link


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •