Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
vladtepes
New Member
New Member



Joined: Feb 03, 2006
Posts: 3

PostPosted: Fri Feb 03, 2006 1:39 pm Reply with quote

Hi everyone;

I just installed rwsRavenNuke76_v2.02.00 and everything is looking good. It looks very usefull and secure distro, thanks a lot raven...

My question is about Mozaks News module, i install that module but its dont working. I get not any error message but i cant see my news too.

I think mozak news uses an old way for querying sql tables. And i dont know how can i fix it.

Any one can help me please? Here is the Mozak News code:

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Advanced Content Management 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.       */
/************************************************************************/

##########################################################################
#                                                       #
#                   Mozaks-News 0.3 BY MOZAKS                   #
#                     (www.mozaks.com)                      #
#                                                       #
#              Support Forum : www.sempoi.net/forum                #
#                                                       #
#                    Enhanced by theDailyRant.net                   #
#                                                       #
#                   (www.thedailyrant.net)                      #
#                                                       #
##########################################################################

/* Config START */

$limit = 5;       // display how many articles per topic
$column = 1;       // number of columns to display - default = 1
$textlength = 34;    // your news title length - if the title is longer than this value,
               // it will be cut and the full name will  be listed in the mouse hover

/* Config END */

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));

// Function to cut long text
function cut($str,$max){
   $count = strlen($str);
   if($count >= $max) {
      for ($pos=$max;$pos>0 && ord($str[$pos-1])>=127;$pos--);
      if (($max-$pos)%2 == 0)
      $str = substr($str, 0, $max) . "...";
      else
      $str = substr($str, 0, $max+1) . "...";
   return $str;
   } else {
   $str = "$str";
   return $str;
   }
}

function index(){
global $limit, $column, $dbi, $textlength;

    include("header.php");
   $copy = "<A HREF=\"http://www.mozaks.com\" target=\"_blank\"><font class=tiny>Powered by Mozaks News 0.3</font></A><br>
          <A HREF=\"http://www.thedailyrant.net\" target=\"_blank\"><font class=tiny>Enhanced by theDailyRant.net</font></A>";
    $result1 = sql_query("SELECT topicid, topicname, topictext, topicimage FROM ".$prefix."_topics where displayhome='1' ORDER BY displayorder", $dbi);

   $x = 1;
   echo "\n<!-- START MOZAKS NEWS 0.3 -->\n"
      ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"center\">";

    while (list($topicid, $topicname, $topictext, $topicimage) = sql_fetch_row($result1, $dbi)) {

   $cnt = sql_num_rows(sql_query("SELECT sid FROM ".$prefix."_stories where topic=$topicid", $dbi), $dbi);
   if ( $cnt > 0 ){
   if( $x>$column ) { $x=1; }
   if( $x==1 ) { echo "<TR>"; }
   else { echo "<td>&nbsp;</td>"; }
   echo "<td align=center valign=top>";

   OpenTableHome();

   echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"center\">\n"
      ."<tr>\n"
      ."<td>"

      // Display the topics image - comment out the line below to remove the image
      //."<img src=\"images/topics/".$topicimage."\">"

      // Display the topics title - comment out the line below to remove the title
      ."<strong>$topictext</strong>"

      // Link to view more stories of the topic
      ."</td><td valign=\"bottom\" align=right>&nbsp;<a href=\"modules.php?name=News&amp;new_topic=".$topicid."\">more..</a>&nbsp;</td>\n"
      ."</tr>\n"
      ."</table>\n";

      // Bold line below topic title
   echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\">\n"
      ."<tr>\n"
      // Topic line's color - you could change the colour code to suit your theme
      ."<td height=0 bgcolor=\"#cccccc\"><img src=modules/Mozaks_News/img/pixel.gif width=1 height=1></td>\n"
      ."</tr>\n"
      ."</table>\n";

    $result = sql_query("SELECT sid, catid, aid, title, time, comments, counter, topic, informant, score, ratings FROM ".$prefix."_stories where topic=$topicid ORDER BY sid DESC limit 0,$limit", $dbi);

    while (list($s_sid, $catid, $aid, $title, $time, $comments, $counter, $topic, $informant, $acomm, $score, $ratings) = sql_fetch_row($result, $dbi)) {

   $Y = substr($time, 2, 2);
   $M = substr($time, 5, 2);
   $D = substr($time, 8, 2);
   
   // Date (D=day, M=month, Y=year) - can be changed to other format such as $M.".".$D.",".$Y;
   $time = $D."/".$M."/".$Y;

   echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
      ."<tr><td>\n"
      ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">\n"
      
      // Change the colour here to match your theme
      ."<tr height=\"20\" onmouseover=\"this.style.backgroundColor='#F9F9F9'\" onmouseout=\"this.style.backgroundColor=''\">\n"

      // News titles begins from here
      ."<td align=\"left\">&nbsp;"

      // Comment / uncomment one of the lines below to display a choice of news image
   
            // !!! it is recommended to use the directory structure below and number the images by the story id !!!
            // Display an image related to the news story - uncomment out the line below to show an image
            //."<img src=\"images/news/".$s_sid.".gif\">"
            
            // Display a bold dot before the news title
            ."<strong><big>&middot;</big></strong>"

      // the link, mouse over and text of the news title
      ."&nbsp;<a href=\"modules.php?name=News&amp;file=article&amp;sid=$s_sid$r_options\" title='".$title."'>"
      .cut($title,$textlength)
      ."</a></td>\n"
      ."<td align=\"right\">["
      
      // Here you can add more info of the news item by commenting and uncommenting the following lines
      ."$counter reads | "
      
      ."$comments comments |"
      
      //."Informant: $informant | "
      
      //."Score: $score | "
            
      ."$time"
      
      ."]&nbsp;</td>\n"

      ."</tr></table></td></tr></table>\n"
      
      // Bold line below topic title
      ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\">\n"
      ."<tr>\n"
      // Topic line's color. You could change the color code to suit your theme
      ."<td height=0 bgcolor=\"#cccccc\"><img src=modules/Mozaks_News/img/pixel.gif width=1 height=1></td>\n"
      ."</tr>\n"
      ."</table>\n";
   
   }
   echo "</td>";
   CloseTableHome();
   if($x==$column) { echo "</TR><tr><td>&nbsp;</td></tr>"; }
   $x++;
    }
   }
   $col = $column+1;
   echo "<tr><td align=right colspan=".$col.">".$copy."</td></tr></table>"
      ."\n<!-- END MOZAKS NEWS 0.3 -->\n";
    include("footer.php");
}

switch ($op) {

    default:
    index();
    break;

}

?>
 
View user's profile Send private message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Feb 03, 2006 2:03 pm Reply with quote

I moved your post to the modules forum as this is not an RN issue.

A link to the download for this might be helpful.
 
View user's profile Send private message Send e-mail
Holbrookau
Hangin' Around



Joined: Jun 25, 2004
Posts: 32

PostPosted: Fri Feb 03, 2006 3:16 pm Reply with quote

This line won't work as the displayhome and displayorder fields dont exist:
Code:
$result1 = sql_query("SELECT topicid, topicname, topictext, topicimage FROM ".$prefix."_topics where displayhome='1' ORDER BY displayorder", $dbi);
Change it to:
Code:
$result1 = sql_query("SELECT topicid, topicname, topictext, topicimage FROM ".$prefix."_topics", $dbi);

There are also calls to non existing functions as well - change:
Code:
OpenTableHome();
to
Code:
OpenTable();
and change:
Code:
CloseTableHome();
to
Code:
CloseTable();
.

This module appears to be rather old and doesn't do much more than the default News module does - I would suggest you find something newer with more features Wink
 
View user's profile Send private message
Guardian2003







PostPosted: Fri Feb 03, 2006 4:05 pm Reply with quote

If you wanted the right blocks to display with this, you would also need to change
Code:
$index=1

to
Code:
define('INDEX_FILE', true);


But yes, you would be far better off using something a little more up to date Wink
 
vladtepes







PostPosted: Fri Feb 03, 2006 5:04 pm Reply with quote

Thanks a lot guys, i will try that fixes right now.

Quote:

This module appears to be rather old and doesn't do much more than the default News module does - I would suggest you find something newer with more features


Yes you are right Holbrookau, default news module doing this job well and i already use it.

I use mozak news module for another thing, i found it very usefull couse i want to see all my news in one page. İ have not many news. Actually i use news section for my articles and with mozak news module i can show them all under "All articles" link...

Thanks a lot again for fixes, i must learn making my own modules.

Greetings from Turkey and sorry for my bad english Smile
 
vladtepes







PostPosted: Fri Feb 03, 2006 5:18 pm Reply with quote

I try that fixes and everything work fine, thanks again.

Anyone want to need this fix, can download the mozak news at this link.

http://www.ateizm.org/downloads/mozaksnews_for_rwsRavenNuke76_v2.02.00.zip
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©