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, 62 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
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Thu Feb 07, 2008 7:36 am Reply with quoteBack to top

i want a block to display the latest, say 5 posts in some categories of the NEWS (stories) modules. is it possible? how to do it?
Find all posts by moodsView user's profileSend private message
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Mon Feb 18, 2008 2:16 am Reply with quoteBack to top

let me explain the situation again

i have some people like news reporters in my site. say i have 3 of them. they post their reports time to time.

i want a block or something that will display these 3 peoples posts (say the last 10) in the index page. Or let them have one column each, whenever that link is clicked from the index page, it should take to another page where all that persons posts will be available.

what is the best way to do? need ur solution Smile
Find all posts by moodsView user's profileSend private message
movieman
Captain
Captain


Joined: Feb 29, 2004
Posts: 301

Location: New York

PostPosted: Mon Feb 18, 2008 12:34 pm Reply with quoteBack to top

I am pretty sure that there is a block that post the last 5 articles already in your block admin.I have a news block that posts the last 10 articles you can see it on my site, you can customize it to your site... you will need to register to download it.
http://www.powrhost.com/modules.php?name=Downloads&d_op=viewdownload&cid=1#cat
Find all posts by moviemanView user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressMSN Messenger
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Mon Feb 18, 2008 6:02 pm Reply with quoteBack to top

thnx movieman for the reply.
i will check ur site and see if it is what i am looking for. the block i ma looking for is what can display a particular user posts only
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Mon Feb 18, 2008 9:26 pm Reply with quoteBack to top

Here is something that may work. Replace "X" with the news reporters "aid".
Code:

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

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.

Last edited by spottedhog on Tue Feb 19, 2008 4:58 am; edited 1 time in total
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: Tue Feb 19, 2008 12:38 am Reply with quoteBack to top

thnx spottedhog
i will try it and report back if it works

btw will this code display the category-wise news or reporter-wise news?
Find all posts by moodsView user's profileSend private message
moods
Corporal
Corporal


Joined: Dec 13, 2005
Posts: 72


PostPosted: Tue Feb 19, 2008 4:17 am Reply with quoteBack to top

tried with this where "reporter" is the username of the news submitter as u suggested
Code:
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-Block_Creator.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
$content  =  "$result = $db->sql_query(\" ";
$content  .= "    SELECT sid, title ";
$content  .= "    FROM {$prefix}_stories ";
$content  .= "    WHERE aid=reporter ";
$content  .= "    ORDER BY sid ";
$content  .= "    DESC LIMIT 5\"); ";
$content  .= "    while ($row = $db->sql_fetchrow($result)) ";
$content  .= "    { ";
$content  .= "   $row['sid']= intval($row['sid']); ";
$content  .= "   $row['title']= check_words(check_html($row['title'], \"nohtml\")); ";
$content  .= "   $content. \"<strong>&middot;</strong>&nbsp;<a href=\\\"modules.php?name=News&amp;file=article&amp;sid=$row['sid']\\\">$row['title']</a><br />\"; ";
$content  .= "   }";
?>


it's not working. where do i go wrong?
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Tue Feb 19, 2008 5:06 am Reply with quoteBack to top

The query should display the last 5 entries for a specific reporter. If you have 3 reporters, you will need to use the code 3 times but put in a different "aid" for each.

Well.... first of all, do not use a Block Creator. That is the main issue.

Create your own block... and copy the code I have here for the main part.

Also, you have:

aid=reporter

that is not correct... in your nuke_stories database table, look in the "aid" field to find the value you need to put where you have "reporter" now.

You may also want to put the Reporter's name above each query.

_________________
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 21, 2008 8:59 am Reply with quoteBack to top

tried with this where i replaced the aid with "user name of the newsreporter"
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\">";
$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 .= "</table>";
$content .= "<br><center>[ <a href=\"modules.php?name=News\">"._MORENEWS."</a> ]</center>";

?>


still not working. actually i have never created a block. please check the code again for me
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Thu Feb 21, 2008 10:32 am Reply with quoteBack to top

2 things.....

firstly, if you are going to use a table, you need to put in the proper html tags to create a table.

for example:

<table><tr><td>
//query content here
</td></tr></table>

^^^please know this is not the exact way to code the block...just showing you the proper way to use html code to create a table.

secondly, you need to put in the author ID where you have the "X"

find: WHERE aid=X
replace "X" with the aid of your reporter. You may need to look in your nuke_stories table to see what the value of "aid" is for each reporter.

_________________
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: Sun Feb 24, 2008 1:55 am Reply with quoteBack to top

i tried WHERE aid=user id of the reporter (replacing the X with the username of the reporter) with and without the table but is not working.

don't know where it i went wrong
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Sun Feb 24, 2008 6:05 am Reply with quoteBack to top

Try this....
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>";

?>


There is a small difference with this code. Please notice the X is inside quotes like this: 'X'

That may be the issue...

_________________
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: Mon Feb 25, 2008 6:08 am Reply with quoteBack to top

still it's not working Evil or Very Mad

whenever i upload the block and activate it, only the right blocks in my site is displayed when index page is opened. i made the code with notepad and saved as block-Filename.php. can it be because of using NOTEPAD?
Find all posts by moodsView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Mon Feb 25, 2008 8:43 am Reply with quoteBack to top

http://www.crimsoneditor.com is a good PHP/HTML editor for Windoz

_________________
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: Tue Feb 26, 2008 5:37 am Reply with quoteBack to top

Smile tried with the text editor. it still didn't work. it has something to do with the script or wat?

i am using phpnuke 8
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.797 Seconds - 287 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::