A Custom Content Module

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   A Custom Content Module
Pheonix
CZ Newbie
Pheonix has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Apr 13, 2004
0.00 posts per day
Posts: 24
Points: 1,643
   
Hey Guys,

I have thus put together the following code to pump out in one set the last 5 pages and links for the Content module and the last 5 categories for the content module as well.

here is the code:



<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-Top10_Downloads.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

global $prefix, $db;

$a = 1;
$sql = "SELECT pid, title FROM ".$prefix."_pages ORDER BY pid DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
    $page = ereg_replace("_", " ", $row[title]);

$content .= "<strong><big>·;</big></strong> ;;<a href=\"modules.php?name=Content&amp;pa=showpage&amp;pid=$row[pid]\">$row[title]</a><BR>";
    $a++;
}

$a = 1;
$sql = "SELECT cid, title FROM ".$prefix."_pages_categories ORDER BY cid DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
    $categories = ereg_replace("_", " ", $row[title]);

$content .= "<big>·;</big> ;;<a href=\"modules.php?name=Content&pa=list_pages_categories&amp;cid=$row[cid]\">$row[title]</a><br></td>";
    $a++;
}

?>


and here is the html template i want it to be in:


<table width="446" height="315" border="0" align="center" cellpadding="0" cellspacing="0" background="Chronicles.gif">
  <tr>
    <td height="35" colspan="4"> ;;</td>
  </tr>
  <tr>
    <td width="46" height="245"></td>
    <td width="177" height="245" valign="top">PAGE CONTENT GOES HERE<br>
       ;;</td>
    <td width="177" height="245" valign="top">CATEGORY CONTENT GOES HERE<br>
       ;;</td>
    <td width="46" height="245"> ;;</td>
  </tr>
  <tr>
    <td height="35" colspan="2"> ;;</td>
    <td height="35" colspan="2"> ;; ;; ;; ;; ;; ;; ;; ;; ;;<strong><a href="modules.php?name=Content">View
      All</a></strong></td>
  </tr>
</table>
]

as ive added in the html i want the page data where it says above i want it as well as for categories. (i know i havent parsed the html file but tell me how to fix it and parsing isnt a problem)

thx in advance


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum