Author |
Message |
ibonic
Hangin' Around
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 12, 2009
Posts: 25
|
Posted:
Mon Nov 16, 2009 8:45 am |
|
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>·</big></strong> $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>·</big></strong> $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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Mon Nov 16, 2009 9:08 am |
|
Read this topic and see if you can get the block to work. If you still need help after reading let us know.
http://www.ravenphpscripts.com/postt16627.html |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Mon Nov 16, 2009 7:03 pm |
|
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>·</big></strong> $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>·</big></strong> $a: <a href=\"viewlink-.html$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
$a++;
}
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ibonic
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Nov 16, 2009 10:11 pm |
|
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>·</big></strong> $a: <a href=\"modules.php?name=Web_Links&l_op=visit&lid=$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>·</big></strong> $a: <a href=\"modules.php?name=Web_Links&l_op=visit&lid=$lid\">$title2</a><br>[$hitstext: $hits]<br><br>";
$a++;
}
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Nov 17, 2009 5:41 am |
|
I happy you solve your problem. What did u change? Can u specify what u modified. Thanks in advance |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|