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, 56 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - hELP display of news [ ]
 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
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Tue Feb 26, 2008 10:11 am Reply with quoteBack to top

Try this... I know this works....

replace X with the aid of the author

Code:
<?php


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

global $prefix, $multilingual, $currentlang, $db;

if ($multilingual == 1) {
    $querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
    $querylang = "";
}
$content = "<table width=\"100%\" border=\"0\"><tr><td>";
$result = $db->sql_query("
    SELECT sid, title
    FROM {$prefix}_stories
    WHERE aid='X'
    ORDER BY sid
    DESC LIMIT 5");
    while ($row = $db->sql_fetchrow($result))
    {
   $row['sid']= intval($row['sid']);
   $row['title']= check_words(check_html($row['title'], "nohtml"));
   $content. ="<strong>&middot;</strong>&nbsp;<a href=\"modules.php?name=News&amp;file=article&amp;sid=$row[sid]\">$row[title]</a><br />";
   }
$content .= "</td></tr></table>";
$content .= "<br /><center>[ <a href=\"modules.php?name=News\">"._MORENEWS."</a> ]</center>";

?>

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Find all posts by spottedhogView user's profileSend private messageSend e-mailVisit poster's website
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Thu Feb 28, 2008 2:26 am Reply with quoteBack to top

i am sorry to let u know that the block still did not work. i copied the code exactly as you posted and changed the X with the id of the newsreporter
still it did not work.

i am using phpnuke 8. what could be wrong?
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Thu Feb 28, 2008 4:36 am Reply with quoteBack to top

when you replaced X, did you leave in the single quote marks?

for example: 'X' and not X

If that does not work, then I am not sure what is wrong. I use a modified version of 7.6, but there should not be much difference.

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Find all posts by spottedhogView user's profileSend private messageSend e-mailVisit poster's website
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Thu Feb 28, 2008 7:40 am Reply with quoteBack to top

yes i use the single quote mark like this 'username'

when i activate the block index page cannot be displayed, only the left blocks are displayed
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Thu Feb 28, 2008 8:52 am Reply with quoteBack to top

I have the following code in a block named "Author News" here:

http://www.smf-nuke.com

It is on the bottom left side.

As far as I know, the only difference to the current PHP Nuke 8.0 and my 7.6 version is that I have made the field "aid" an integer field, while I am sure 8.0 still uses a varchar field.

Replace the aid='1'

with:

aid='username'

...where username is the author username.

Code:
<?php

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

global $db, $prefix;
$content = "";
$content .= "<table width=\"100%\" border=\"0\"><tr><td class=\"content\">";
$result = $db->sql_query("
    SELECT sid, title
    FROM {$prefix}_stories
    WHERE aid='1'
    ORDER BY sid
    DESC LIMIT 5");
    while ($row = $db->sql_fetchrow($result))
    {
   $row['sid']= intval($row['sid']);
   $row['title']= check_words(check_html($row['title'], "nohtml"));
   $content .= "<strong>&middot;</strong>&nbsp;<a href=\"modules.php?name=News&amp;file=article&amp;sid=$row[sid]\">$row[title]</a><br />";
   }
$content .= "</td></tr></table>";
$content .= "<br /><center>[ <a href=\"modules.php?name=News\">"._MORENEWS."</a> ]</center>";

?>



If this still does not work, please copy/paste the error line here. You may need to enable errors in the config.php file.

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Find all posts by spottedhogView user's profileSend private messageSend e-mailVisit poster's website
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Thu Feb 28, 2008 6:27 pm Reply with quoteBack to top

yes it works now. thanks a lot spottedhog Very Happy

actually i may need many more codings. so be there Smile
Find all posts by moodsView user's profileSend private message
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
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.631 Seconds - 357 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::