PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
ibonic
New Member
New Member


Joined: Aug 12, 2009
Posts: 2

PostPosted: Mon Nov 16, 2009 8:45 am Reply with quote Back to top

This is a scrolling block that shows the weblinks, it works great in Php-nuke, but when I tried to install it in RavenNuke it doesnt work, I was hoping someone would know how to convert this to work in RavenNuke.


Code:

<?php

/************************************************************************/
/* Advanced Links Block                                             */
/* ===========================                                          */
/*                                                                      */
/* This is basically just an edit of the original block by Francisco.   */
/* Even though this is heavly edited, I think he deserves credit, so:   */
/*                                                                      */
/* 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.       */
/************************************************************************/
/*                                                                      */
/* Copyright © 2002 by Michael Bacoz                                    */
/* http://www.fatal-instinct.com                                        */
/*                                                                      */
/************************************************************************/

/************************/
/*      Variables       */
/************************/

$downloadstoshow = 5;
$usemarquee = 1;
$scrolldirection = "Up";

$most = "Most Hits";
$latest = "Latest Links";
$totalfiles = "Total Links";
$totalcategories = "Total Categories";
$totaldownloads = "Total Hits";
$hitstext = "Hits";

/************************/
/*     End Variables    */
/************************/

// Make sure people don't try and access it directly
if (eregi("block-Advanced_Links.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}

global $prefix, $dbi;

// Total Files
$result = sql_query("select * from ".$prefix."_links_links", $dbi);
$files = sql_num_rows($result, $dbi);

// Total Categories
$result = sql_query("select * from ".$prefix."_links_categories", $dbi);
$cats = sql_num_rows($result, $dbi);

// Total Downloads
$result = sql_query("select hits from ".$prefix."_links_links", $dbi);

$a = 1;
while(list($hits) = sql_fetch_row($result, $dbi)) {
     $total_hits = $total_hits + $hits;
      $a++;
}

$content .= "$totalfiles: $files<br>$totalcategories: $cats<br> $totaldownloads: $total_hits<br>";
 
if ($usemarquee == 1) {
   $content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"140\" ScrollAmount=\"2\" ScrollDelay=\"100\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
}

// Latest added
$content .= $latest."<br>";
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_links_links order by date DESC limit 0,$downloadstoshow", $dbi);

while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
      $title2 = ereg_replace("_", " ", $title);
      
     $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
      $a++;
}

// Most downloaded
$content .= "<br>".$most."<br>";
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_links_links order by hits DESC limit 0,$downloadstoshow", $dbi);

while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
    $title2 = ereg_replace("_", " ", $title);
    $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
    $a++;
}

?>


Thank you

*** Edited by Palbin to put code in code tags.
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2456
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Nov 16, 2009 9:08 am Reply with quote Back to top

Read this topic and see if you can get the block to work. If you still need help after reading let us know.
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 432

PostPosted: Mon Nov 16, 2009 7:03 pm Reply with quote Back to top

Here it is my convertion. I didnt test it yet but you can do it and let me know

Code:
<?php

/************************************************************************/
/* Advanced Links Block                                             */
/* ===========================                                          */
/*                                                                      */
/* This is basically just an edit of the original block by Francisco.   */
/* Even though this is heavly edited, I think he deserves credit, so:   */
/*                                                                      */
/* 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.       */
/************************************************************************/
/*                                                                      */
/* Copyright © 2002 by Michael Bacoz                                    */
/* http://www.fatal-instinct.com                                        */
/*                                                                      */
/************************************************************************/

/************************/
/*      Variables       */
/************************/

$downloadstoshow = 5;
$usemarquee = 1;
$scrolldirection = "Up";

$most = "Most Hits";
$latest = "Latest Links";
$totalfiles = "Total Links";
$totalcategories = "Total Categories";
$totaldownloads = "Total Hits";
$hitstext = "Hits";

/************************/
/*     End Variables    */
/************************/

// Make sure people don't try and access it directly
if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

global $prefix, $db;

// Total Files
$result = $db->sql_query("select * from ".$prefix."_links_links");
$files = $db->sql_numrows($result);

// Total Categories
$result = $db->sql_query("select * from ".$prefix."_links_categories");
$cats = $db->sql_numrows($result);

// Total Downloads
$result = $db->sql_query("select hits from ".$prefix."_links_links");

$a = 1;
while(list($hits) = $db->sql_fetchrow($result)) {
     $total_hits = $total_hits + $hits;
      $a++;
}

$content .= "$totalfiles: $files<br>$totalcategories: $cats<br> $totaldownloads: $total_hits<br>";

if ($usemarquee == 1) {
   $content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"140\" ScrollAmount=\"2\" ScrollDelay=\"100\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
}

// Latest added
$content .= $latest."<br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_links_links order by date DESC limit 0,$downloadstoshow");

while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
      $title2 = ereg_replace("_", " ", $title);
       
     $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
      $a++;
}

// Most downloaded
$content .= "<br>".$most."<br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_links_links order by hits DESC limit 0,$downloadstoshow");

while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
    $a++;
}

?>
View user's profile Send private message
ibonic
New Member
New Member


Joined: Aug 12, 2009
Posts: 2

PostPosted: Mon Nov 16, 2009 10:11 pm Reply with quote Back to top

Hi unicornio, I tried it, changed one thing and now its works heres the complete working code, thank you very much for your help:

Code:
 
<?php

/************************************************************************/
/* Advanced Links Block                                             */
/* ===========================                                          */
/*                                                                      */
/* This is basically just an edit of the original block by Francisco.   */
/* Even though this is heavly edited, I think he deserves credit, so:   */
/*                                                                      */
/* 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.       */
/************************************************************************/
/*                                                                      */
/* Copyright © 2002 by Michael Bacoz                                    */
/* http://www.fatal-instinct.com                                        */
/*                                                                      */
/************************************************************************/

/************************/
/*      Variables       */
/************************/

$downloadstoshow = 5;
$usemarquee = 1;
$scrolldirection = "Up";

$most = "Most Hits";
$latest = "Latest Links";
$totalfiles = "Total Links";
$totalcategories = "Total Categories";
$totaldownloads = "Total Hits";
$hitstext = "Hits";

/************************/
/*     End Variables    */
/************************/

// Make sure people don't try and access it directly
if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

global $prefix, $db;

// Total Files
$result = $db->sql_query("select * from ".$prefix."_links_links");
$files = $db->sql_numrows($result);

// Total Categories
$result = $db->sql_query("select * from ".$prefix."_links_categories");
$cats = $db->sql_numrows($result);

// Total Downloads
$result = $db->sql_query("select hits from ".$prefix."_links_links");

$a = 1;
while(list($hits) = $db->sql_fetchrow($result)) {
     $total_hits = $total_hits + $hits;
      $a++;
}

$content .= "$totalfiles: $files<br>$totalcategories: $cats<br> $totaldownloads: $total_hits<br>";

if ($usemarquee == 1) {
   $content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"140\" ScrollAmount=\"2\" ScrollDelay=\"100\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
}

// Latest added
$content .= $latest."<br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_links_links order by date DESC limit 0,$downloadstoshow");

while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
      $title2 = ereg_replace("_", " ", $title);
       
     $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
      $a++;
}

// Most downloaded
$content .= "<br>".$most."<br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_links_links order by hits DESC limit 0,$downloadstoshow");

while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $content .= "<strong><big>&middot;</big></strong>&nbsp;$a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
    $a++;
}

?>
View user's profile Send private message
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 432

PostPosted: Tue Nov 17, 2009 5:41 am Reply with quote Back to top

I happy you solve your problem. What did u change? Can u specify what u modified. Thanks in advance
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum