Home arrow Forum can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
  Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 11:03:14 PM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Addon Discussion
| |-+  Joomla Modules
| | |-+  can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?  (Read 1232 times)
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
« on: January 12, 2007, 10:37:19 PM »

Hi,

I have my SMF forum set to no guess access, but i want the mod_smf_recenttopics module in my Joomla frontpage, to show the topics, and when user clicks on topic link heīll find out that he is not allowed to see the topic unless he registers.

Canīt this be done? Right now the recent topics module is displaying blank to guests  Cry

Cheers,
NiCo
Logged
-Wolverine
Developer
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
« Reply #1 on: January 13, 2007, 09:25:48 AM »

The recent topics can only use permissions on a per board level.  So if your Forum is set to disallow guests but each board is set to public, it will show your boards and then give the error.  Generally speaking, I use the same query that is found in SSI.php, so it is written by SMF. 

My question is, why not simply set the recent topics module to registered in Joomla?  Then no guests even see the module.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Re: can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
« Reply #2 on: January 13, 2007, 10:06:27 AM »

Great Grin it works as you say, if i set each board to permit access to guest, but then i disallow global SMF guest access.

The reason why i want the recent topics to work like this is because my site will have as one of its major key points the quality of the topics being discussed(so i hope, hehehe). I will use a "Register to read the whole article and/or to read/post in the forum" approach.

Therefore the mod_smf_recenttopics in the frontpage is another very good way of showing to first-time visitors to my site that itīs worth registering.

The other way to tempt them i also use is to show only the intro of articles to guest, but must register to read the whole article.

Thanks for replying anyway  Wink
NiCo
Logged
-Wolverine
Developer
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: can mod_smf_recenttopics show topics to joomla guests if forum allows no gue
« Reply #3 on: January 13, 2007, 10:37:25 AM »

I see


you could simply list the topics to guests instead of allowing them to be clickable links.  In the code make the following changes, on or around line 250 change this code:

Code:
//Start subject link
echo '<a class="latestnews'.$moduleclass_sfx.'" href="'.$post['href'].'" ';
//external links
if ($external) {
    echo 'target="_blank" ';
}
echo '>';

To this:
Code:
//Start subject link
if (!$user_info['is_guest']) {
    echo '<a class="latestnews'.$moduleclass_sfx.'" href="'.$post['href'].'" ';
    //external links
    if ($external) {
        echo 'target="_blank" ';
    }
    echo '>';
}

And then on or around line 290 change this code:

Code:
echo '</a>';

to this:
Code:
if (!$user_info['is_guest']) {
    echo '</a>';
}

That will show the text but not link it.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Re: can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
« Reply #4 on: January 13, 2007, 10:48:48 AM »

Thank you very much Wolverine  Smiley

For now i prefer to leave the links for guests. I know it sounds weird, but in my case(it might not suit all type of communities) i want to leave it clear that "You interested in this? Then you must register". I left the normal behaviour(guest clicks on link and is taken to the Login/Register box) but i changed the language defines a little bit to include a link to the cb user register page and also a link explaining why i require registration, blah blah blah).

But thanks for posting this hack anyway. I write it down in case i have to change approach ;-)

Cheers,
NiCo
Logged
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Re: can mod_smf_recenttopics show topics to joomla guests if forum allows no guests?
« Reply #5 on: January 13, 2007, 10:53:04 AM »

Plus i am using another module next to the recent topics to display latest reviews to articles that has the same functionality. It displays links to reviews in the frontpage for everybody, but when guest clicks gets "must login or register" page  Smiley

Cheers,
NiCo
« Last Edit: January 13, 2007, 10:55:10 AM by GlingGlo » Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
Search Contact About Advertise Blogs Topsites Submit News Register Login