You are missing our premiere tool bar navigation system! Register and use it for FREE!


Author: meetzahPostPosted: Tue Aug 21, 2007 11:14 am    Post subject:

I forgot about this post.. I managed to create this hack. Here is my code. It may not be nice but it works Wink


NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 

Author: stingLocation: Apparently ALWAYS Online. . .PostPosted: Tue Aug 21, 2007 10:59 am    Post subject:

Is it giving you any kind of error message?

And also, I am admittedly a little rusty with my block code, but doesn't the variable have to be separated from the quotes?

Example:
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 322 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - block to display news sent by online members block to display news sent by online members

Nuke Cops -> Blocks

Author: meetzah PostPosted: Tue Jun 26, 2007 2:46 pm    Post subject: block to display news sent by online members

Hello,

I try to create a block to display the stories submitted by the members that are online on the website on that moment. So, if there is logged in user1, user2, and user3 this module has to display all the stories submitted by user1, user2 and userr3.

Here is what I did, but is not working... cand you please give me a tip:

Code:
<?php

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

$content = "";

global $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $sitekey, $gfx_chk, $locale;
$sql3 = "SELECT uname, guest FROM ".$prefix."_session WHERE guest='0'";
$result = $db->sql_query($sql3);

    $sql7 = "SELECT sid, title FROM ".$prefix."_stories WHERE informant='$uname' ORDER BY sid DESC LIMIT 0,10";
    $result7 = $db->sql_query($sql7);
    while($row7 = $db->sql_fetchrow($result7)) {
   $sid = intval($row7['sid']);
   $title = stripslashes(check_html($row7['title'], "nohtml"));
        $content .= "<li><a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\">$title</a><br>";
    }

?>
Code:

$content .= "<li><a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\">$title</a><br>";


Would be

Code:

$content .= "<li><a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\">" . $title . "</a><br>";


similar to the sql calls where the $prefix variable is separated by the period....

-sting
Code:
if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

$content = "";

global $user, $cookie, $db, $locale;
$sql = "SELECT nuke_session.uname, nuke_session.guest, nuke_stories.sid, nuke_stories.title FROM nuke_session INNER JOIN nuke_stories ON nuke_session.uname = nuke_stories.informant WHERE nuke_session.guest ='0'";
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($sql);
$numrows = intval($numrows);
while ($row = mysql_fetch_array ($result)) {
  $content .= " <a href=http://www.example.com/article".$row[sid].".html>".$row[title]."</a><br>\n";


Please be carefull how you format the link. I use mod_rewrite and that is the reason I linked directly to the rewrited pages.



Nuke Cops -> Blocks

All times are GMT - 8 Hours

Page 1 of 1

Powered by phpBB © 2001,2002 phpBB Group
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.032 Seconds - 255 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
added by Evaders - DO NOT REMOVE
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::