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

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
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, 342 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 [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
meetzah
Private
Private


Joined: Dec 29, 2005
Posts: 38


PostPosted: Tue Jun 26, 2007 2:46 pm Reply with quoteBack to top

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>";
    }

?>

_________________
AdSense Sucks !!!
Find all posts by meetzahView user's profileSend private messageVisit poster's website
sting
Site Admin
Site Admin


Joined: Jul 24, 2003
Posts: 1986

Location: Apparently ALWAYS Online. . .

PostPosted: Tue Aug 21, 2007 10:59 am Reply with quoteBack to top

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:
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

_________________
Is it paranoia if they are really out to get you?

-------------------------------------------------------
sting usually hangs out at nukehaven.net
Find all posts by stingView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
meetzah
Private
Private


Joined: Dec 29, 2005
Posts: 38


PostPosted: Tue Aug 21, 2007 11:14 am Reply with quoteBack to top

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


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.

_________________
AdSense Sucks !!!
Find all posts by meetzahView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
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.035 Seconds - 235 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::