Fork me on GitHub

This Code enables block to list weblinks of particular categ  Bottom

  • This Code enables a block to list weblinks of particular category. In my case below 9, and 10. I hope this code is cleaned up and melded into the core modules.

    include 'config.php';

    $blockname_cat_id_header ="9";
    $cat_id="10";
    $sub_url="modules.php?op=modload&name=Web_Links&file=index&req=visit&lid=";

    $pnconfig['dbuname'] = base64_decode($pnconfig['dbuname']);
    $pnconfig['dbpass'] = base64_decode($pnconfig['dbpass']);

    /* Connecting, selecting database */

    $link = mysql_connect($pnconfig['dbhost'], $pnconfig['dbuname'], $pnconfig['dbpass']) or die("\n
    Could not connect to " . $pnconfig['dbhost'] . "
    ");

    mysql_select_db($pnconfig['dbname']) or die("\n
    Could not select " . $pnconfig['dbname'] . "
    ");

    /* to print the block name taken from category name*/
    $sql_blockname ="SELECT pn_title FROM pn_links_categories where pn_cat_id = $blockname_cat_id_header";

    $result_blockname = mysql_query($sql_blockname) or die("
    Failed query = $sql_blockname: " . mysql_error());

    while ($row = mysql_fetch_array($result_blockname) ) {

    echo "\n";

    echo "\n";
    echo "\n\n";

    echo "\n" . "\n";

    echo "\n";
    echo "\n" . "\n\n";
    echo "
    \"\"
    \n";

    echo "\n";

    echo "\n" . "\n\n";

    echo "
    $row[0]
    \n" . "
    \"\"
    ";

    }

    $SQL = "SELECT pn_lid, pn_title, pn_url FROM pn_links_links WHERE pn_cat_id = $cat_id order by pn_title";

    $result = mysql_query($SQL) or die("
    Failed query = $SQL: " . mysql_error());

    while ($row = mysql_fetch_array($result) ) {

    printf("<big>·</big> %s
    \n", pnGetBaseURL(),$sub_url, $row[0], $row[1] );

    }

    mysql_free_result($result);
  • Just found this and it looks useful, but where does it go?

This list is based on users active over the last 60 minutes.