Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Creating a Block that lists active site Topics

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic
Author Message
Exodus

Beginner
Beginner


Joined: Oct 02, 2004
Posts: 18

PostPosted: Sun Oct 17, 2004 10:24 pm    Post subject: Creating a Block that lists active site Topics Reply with quote

Hello, I'm trying to create a Block called "Main Menu" that lists site topics (not forum topics). For instance my site is about unknown/paranormal happenings so I want the "Main Menu" Block to list my topics such as
Ghosts & Huantings
Aliens & UFO's
and so on...........

and when a visitor one (lets say Aliens & UFO's) , then the center block will pull up that topic.

If anyone can help me figure this out I would appreciate it very much!

Thanks -
Exodus
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Creating a Block that lists active site Topics  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6276
Location: Washington Township, NJ, USA

PostPosted: Mon Oct 18, 2004 7:16 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

create a block file called block-Topics.php and put this in it:
PHP: › <?php

if (eregi("block-Topics.php",$_SERVER['PHP_SELF'])) {         
    
Header("Location: index.php");
}

global 
$db,$prefix;

$result $db->sql_query("SELECT topicid,topictext FROM ".$prefix."_topics");

while(
$row $db->sql_fetchrow($result)){ 
        
$content .= "<a href=\"article-topic-.html".$row['topicid']."\">".$row['topictext']."</a><br>";
}
?>

_________________
Back to top
Offline View user's profile Send private message Visit poster's website
Exodus

Beginner
Beginner


Joined: Oct 02, 2004
Posts: 18

PostPosted: Mon Oct 18, 2004 7:53 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

That is almost perfect! Thank you so much! Would it be hard to make the list spread out a little with bullets in front of them (like on the block-modules)?

Thanks!!

Eric -

-- One more thing, I just noticed that each Topic link dosent seem to know which topic number corresponds with it, so I get a "not found" type error when I click on one.
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6276
Location: Washington Township, NJ, USA

PostPosted: Mon Oct 18, 2004 8:10 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

PHP: › <?php

if (eregi("block-Topics.php",$_SERVER['PHP_SELF'])) {         
    
Header("Location: index.html");
}

global 
$db,$prefix;

$result $db->sql_query("SELECT topicid,topictext FROM ".$prefix."_topics");

while(
$row $db->sql_fetchrow($result)){
        
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=News&amp;new_topic=".$row['topicid']."\">".$row['topictext']."</a><br>";
}
?>

_________________
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6276
Location: Washington Township, NJ, USA

PostPosted: Mon Oct 18, 2004 8:11 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

sorry for the other problem you were having, the Googletap f*cked up the URL in the href. my post above has it fixed.
_________________


Last edited by dari on Mon Oct 18, 2004 8:51 am; edited 1 time in total
Back to top
Offline View user's profile Send private message Visit poster's website
Exodus

Beginner
Beginner


Joined: Oct 02, 2004
Posts: 18

PostPosted: Mon Oct 18, 2004 8:24 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

Update - Very Happy I fixed the link issue, they work GREAT, the only thing I would like to change is the line spacing and add bullets. THANK YOU!
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6276
Location: Washington Township, NJ, USA

PostPosted: Mon Oct 18, 2004 8:30 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

see my post after your "That's almost perfect" post. It has bullets.
_________________


Last edited by dari on Mon Oct 18, 2004 8:32 am; edited 1 time in total
Back to top
Offline View user's profile Send private message Visit poster's website
Exodus

Beginner
Beginner


Joined: Oct 02, 2004
Posts: 18

PostPosted: Mon Oct 18, 2004 8:32 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

-------------
--------------
Sorry I didnt realized the code fixed both problems! You are great! I've been going crazy over this for a week!

Thanks again!
Eric
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6276
Location: Washington Township, NJ, USA

PostPosted: Mon Oct 18, 2004 8:51 am    Post subject: Re: Creating a Block that lists active site Topics Reply with quote

No problem, glad to be of service Smile
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic

 
Jump to:  
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
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSearch Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaSEO

6th year online! 2003-2008
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia