 | [Solved] "View unanswered posts" link |  |
Posted: 06/17/2007 4:41 AM |
|
|
|
|
|
| Citation |
| Posts |
1332 |
| Word Cnt. |
86,126 |
| BDay |
Feb 11 |
| Sign |
Aquarius |
| Sex |
 |
|
|
|
Joined: Mar 31, 2007
Local time: 8:39 PM
Location: Birmingham, UK.
|

|
|
|
|
 |
| Nightrider, how do i get the "View unanswered posts" link to show to guests!?!? |
|
|
 |
 |
| Back to Top |
|
|
 | Re: "View unanswered posts" link |  |
Posted: 06/17/2007 6:23 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
Currently all of those links are embedded in a Switch for Logged in users in your index_body.tpl file.
| Code:
|
<!-- BEGIN switch_user_logged_in -->
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />
<a href="{U_SEARCH_NEW_TOPICS}" class="gensmall">{L_SEARCH_NEW_TOPICS}</a><br />
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a><br />
<a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
<a href="{U_SEARCH_SELF_TOPICS}" class="gensmall">{L_SEARCH_SELF_TOPICS}</a><br />
<!-- END switch_user_logged_in -->
|
If you want anything from this group to be available to both guests and members, you need to move the link outside of the switch_user_logged_in switch. Notice that there is a begin and end line for this switch, so everything in between can only be seen by logged in members...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] "View unanswered posts" link |  |
Posted: 06/17/2007 6:41 AM |
|
|
|
|
|
| Citation |
| Posts |
1332 |
| Word Cnt. |
86,126 |
| BDay |
Feb 11 |
| Sign |
Aquarius |
| Sex |
 |
|
|
|
Joined: Mar 31, 2007
Local time: 8:39 PM
Location: Birmingham, UK.
|

|
|
|
|
 |
I had trouble with this before because i wanted the links to show like this
| Code:
|
View posts since last visit (0)
View topics since last visit
View unanswered posts
View your posts
View your topics
|
but when placing the UNANSWERED link under U_SEARCH_SELF_TOPICS
the links then appear like this
| Code:
|
View posts since last visit (0)
View topics since last visit
View your posts
View your topics
View unanswered posts
|
hope you know what i mean NR  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: "View unanswered posts" link |  |
Posted: 06/17/2007 6:48 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
You could use more than one set of switches to get this to display as you want. You would do something like this:
OPEN
index_body.tpl
FIND
| Code:
|
<!-- BEGIN switch_user_logged_in -->
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />
<a href="{U_SEARCH_NEW_TOPICS}" class="gensmall">{L_SEARCH_NEW_TOPICS}</a><br />
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a><br />
<a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
<a href="{U_SEARCH_SELF_TOPICS}" class="gensmall">{L_SEARCH_SELF_TOPICS}</a><br />
<!-- END switch_user_logged_in -->
|
REPLACE WITH
| Code:
|
<!-- BEGIN switch_user_logged_in -->
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />
<a href="{U_SEARCH_NEW_TOPICS}" class="gensmall">{L_SEARCH_NEW_TOPICS}</a><br />
<!-- END switch_user_logged_in -->
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a><br />
<!-- BEGIN switch_user_logged_in -->
<a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
<a href="{U_SEARCH_SELF_TOPICS}" class="gensmall">{L_SEARCH_SELF_TOPICS}</a><br />
<!-- END switch_user_logged_in -->
|
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] "View unanswered posts" link |  |
Posted: 06/17/2007 6:59 AM |
|
|
|
|
|
| Citation |
| Posts |
1332 |
| Word Cnt. |
86,126 |
| BDay |
Feb 11 |
| Sign |
Aquarius |
| Sex |
 |
|
|
|
Joined: Mar 31, 2007
Local time: 8:39 PM
Location: Birmingham, UK.
|

|
|
|
|
 |
Perfect!
Another thing
When a user is logged in they can see a number next to "View posts since last visit". Is it possible to do the same with View topics since last visit? |
|
|
 |
 |
| Back to Top |
|
|
 | Re: "View unanswered posts" link |  |
Posted: 06/18/2007 1:52 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
Yes, it would be possible, but you would have to do something like what they are doing to count the new posts in your MOD_newposts_number.php file. That whole file is devoted to counting the number of new posts. As you can see, it isn't a small file. You could probably duplicate the file and change the SQL queries to pull from the Topics table. This is not a small request though even though it sounds like it since all you want is a number...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] "View unanswered posts" link |  |
Posted: 06/18/2007 5:32 AM |
|
|
|
|
|
| Citation |
| Posts |
1332 |
| Word Cnt. |
86,126 |
| BDay |
Feb 11 |
| Sign |
Aquarius |
| Sex |
 |
|
|
|
Joined: Mar 31, 2007
Local time: 8:39 PM
Location: Birmingham, UK.
|

|
|
|
|
 |
I got this of phpBB.com ( http://www.phpbb.com/community/viewtopic.php?f=15&t=222168&st=0&sk=t&s d=a&start=15 )
| Code:
|
if( $userdata['session_logged_in'] )
{
$sql = "SELECT COUNT(topic_id) as total
FROM " . TOPICS_TABLE . "
WHERE topic_time >= " . $userdata['user_lastvisit'] . "
AND topic_poster != " . $userdata['user_id'] . "
AND topic_first_post_id > " . 0 ;
$result = $db->sql_query($sql);
if( $result )
{
$row = $db->sql_fetchrow($result);
$lang['Search_new_topics'] = $lang['Search_new_topics'] . " (" . $row['total'] . ")";
}
$db->sql_freeresult($result);
}
|
Theres no mention of where to use the code though  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: "View unanswered posts" link |  |
Posted: 06/18/2007 10:38 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
This code will count all new topics whether the member has access to the forums where they are posted or not. If that is acceptable to you, then I can create a MOD that would add this to your forum...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] "View unanswered posts" link |  |
Posted: 06/19/2007 1:52 AM |
|
|
|
|
|
| Citation |
| Posts |
1332 |
| Word Cnt. |
86,126 |
| BDay |
Feb 11 |
| Sign |
Aquarius |
| Sex |
 |
|
|
|
Joined: Mar 31, 2007
Local time: 8:39 PM
Location: Birmingham, UK.
|

|
|
|
|
 |
not sure about that to be honest, the latter would be cool though. I'd like it on your forum to  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: "View unanswered posts" link |  |
Posted: 06/19/2007 2:41 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
|
|
 |
 |
| Back to Top |
|
|
 | Information |  |
|