| Mod help - again | |
Posted: 01/09/2006 3:55 PM |
|
|
|
|
Citation |
Posts |
2152 |
Word Cnt. |
78,257 |
BDay |
Jun 15 |
Sign |
Gemini |
Sex |
|
|
|
|
Joined: Apr 22, 2005
Local time: 6:50 AM
Location: Upside down
|
|
|
|
|
|
This mod - Users viewing forum on Index http://www.phpbb.com/phpBB/viewtopic.php?t=355395
I'm posting here because I'm not getting much helo over at phpbb.com.
This mod is supposed to show how many people are viewing a forum like this -
http://img382.imageshack.us/img382/3443/ssdem1re.jpg
But on my board it appears like this -
http://img212.imageshack.us/img212/5021/1view7up.jpg
Notice the gap between the forum name and forum description. It is the same with all forums.
Here is the code -
Code:
|
#################################################################
## MOD Title: Users viewing forum on Index
## MOD Author: Eminem_Fan < N/A > (Dean Oakes) N/A
## MOD Description: This modification will add the 'vBulletin Style' Users viewing this forum to the index.
## MOD Version: 1.1.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: index.php
## language/lang_english/lang_main.php
## templates/subSilver/index_body.tpl
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## As requested by oo1985, This feature can be found in vBulletin.
##############################################################
## MOD History:
##
## 2005-26-12 - Version 0.1.0
## - Stable Release
##
## 2005-27-12 - Version 1.0.0
## - Submitted to the MOD-DB.
##
## 2006-07-01 - Version 1.1.0
## - Fixed up the mod template and resubmitted.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Get the user count viewing the forums.
//
$forum_view_count = array();
$sql = "SELECT u.user_id, s.session_page
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 );
if(! $result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Unable to get current sessions for users viewing forum.', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
if(! isset($forum_view_count[ $row['session_page'] ]) )
{
$forum_view_count[ $row['session_page'] ] = 0;
}
$forum_view_count[ $row['session_page'] ]++;
}
#
#-----[ FIND ]------------------------------------------
#
'L_ONLINE_EXPLAIN' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_USERS_VIEWING' => $lang['users_viewing_forum'],
#
#-----[ FIND ]------------------------------------------
#
$row_class = ( !($i % 2) ) ?
#
#-----[ AFTER, ADD ]------------------------------------------
#
$users_viewing = $forum_view_count[$forum_data[$j]['forum_id']];
#
#-----[ FIND ]------------------------------------------
#
'MODERATORS' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'USERS_VIEWING' => $users_viewing,
#
#-----[ FIND ]------------------------------------------
#
'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if($users_viewing)
{
$template->assign_block_vars('catrow.forumrow.switch_users_viewing', array());
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['users_viewing_forum'] = 'Viewing';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
#
#-----[ REPLACE WITH ]------------------------------------------
#
</span><span class="gensmall">
<!-- BEGIN switch_users_viewing -->
({catrow.forumrow.USERS_VIEWING} {L_USERS_VIEWING})
<!-- END switch_users_viewing -->
</span> <span class="genmed"><br />{catrow.forumrow.FORUM_DESC}<br />
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
Ok, I thought that the gap had something to do with the <br/> tags in the index_body.tpl file like this -
Code:
|
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
#
#-----[ REPLACE WITH ]------------------------------------------
#
</span><span class="gensmall">
<!-- BEGIN switch_users_viewing -->
({catrow.forumrow.USERS_VIEWING} {L_USERS_VIEWING})
<!-- END switch_users_viewing -->
</span> <span class="genmed"><br />{catrow.forumrow.FORUM_DESC}<br />
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
You will notice an extra <br/> there so I removed the first one and sure it closed the gap but the (* viewing) part is still on the same line. There must be another part that places this next to the forum name like in the first picture I posted but I cannot work that part out. Any ideas?
Thanks |
|
|
|
|
Back to Top |
|
|
| Mod help - again | |
Posted: 01/09/2006 10:22 PM |
|
|
|
|
Site Admin |
Posts |
30756 |
Word Cnt. |
2,628,678 |
BDay |
Jul 28 |
Sign |
Leo |
Sex |
|
|
|
|
Joined: Sep 25, 2004
Local time: 4:50 PM
Location: St Pete, FL
|
|
|
|
|
|
Is this what you had in mind???
If so, then you had an extra <br /> on the previous line from the code that was added...
|
|
|
|
|
Back to Top |
|
|
| Re: Mod help - again | |
Posted: 01/09/2006 10:49 PM |
|
|
|
|
Citation |
Posts |
2152 |
Word Cnt. |
78,257 |
BDay |
Jun 15 |
Sign |
Gemini |
Sex |
|
|
|
|
Joined: Apr 22, 2005
Local time: 6:50 AM
Location: Upside down
|
|
|
|
|
|
yep it is. Where abouts was that because the only two of those tags I saw were in this line -
Code:
|
</span> <span class="genmed"><br />{catrow.forumrow.FORUM_DESC}<br />
|
I removed the first br tag and and the (*viewing) was appearing in the same line as the forum description
I tried to solve it myself but ohh well. Thanks. |
|
|
|
|
Back to Top |
|
|
| Re: Mod help - again | |
Posted: 01/09/2006 11:09 PM |
|
|
|
|
Citation |
Posts |
2152 |
Word Cnt. |
78,257 |
BDay |
Jun 15 |
Sign |
Gemini |
Sex |
|
|
|
|
Joined: Apr 22, 2005
Local time: 6:50 AM
Location: Upside down
|
|
|
|
|
|
Would you know if it was possible to change the text colour of the (*viewing) ? |
|
|
|
|
Back to Top |
|
|
| Mod help - again | |
Posted: 01/09/2006 11:19 PM |
|
|
|
|
Site Admin |
Posts |
30756 |
Word Cnt. |
2,628,678 |
BDay |
Jul 28 |
Sign |
Leo |
Sex |
|
|
|
|
Joined: Sep 25, 2004
Local time: 4:50 PM
Location: St Pete, FL
|
|
|
|
|
|
Of course it's possible. I will have to help you with that later though. I'm struggling with a few problems of my own right now. My HDD is going bad. Luckily it is still under warranty, so I need to get everything I can backed up and hopefully burned to DVD so that I can package it and get it shipped back to Maxtor...
My PC crashed for the 4th time today in 2 weeks, but this time I didn't have to restore the image. I ran Maxtor's HDD utility from Hiren's BootCD today and found that the HDD is definitely the problem...
|
|
|
|
|
Back to Top |
|
|
| Re: Mod help - again | |
Posted: 01/09/2006 11:21 PM |
|
|
|
|
Site Admin |
Posts |
30756 |
Word Cnt. |
2,628,678 |
BDay |
Jul 28 |
Sign |
Leo |
Sex |
|
|
|
|
Joined: Sep 25, 2004
Local time: 4:50 PM
Location: St Pete, FL
|
|
|
|
|
|
Glenn I wrote:
|
yep it is. Where abouts was that because the only two of those tags I saw were in this line -
|
The extra <br /> was in the previous line, not added by the MOD...
|
|
|
|
|
Back to Top |
|
|
| Re: Mod help - again | |
Posted: 01/10/2006 12:02 AM |
|
|
|
|
Citation |
Posts |
2152 |
Word Cnt. |
78,257 |
BDay |
Jun 15 |
Sign |
Gemini |
Sex |
|
|
|
|
Joined: Apr 22, 2005
Local time: 6:50 AM
Location: Upside down
|
|
|
|
|
|
Bummer about your drive. No hurry.
Quote:
|
The extra was in the previous line, not added by the MOD...
|
Ok, thats why I didn't see it. |
|
|
|
|
Back to Top |
|
|
| Re: Mod help - again | |
Posted: 01/12/2006 10:01 PM |
|
|
|
|
Site Admin |
Posts |
30756 |
Word Cnt. |
2,628,678 |
BDay |
Jul 28 |
Sign |
Leo |
Sex |
|
|
|
|
Joined: Sep 25, 2004
Local time: 4:50 PM
Location: St Pete, FL
|
|
|
|
|
|
Glenn I wrote:
|
Would you know if it was possible to change the text colour of the (*viewing) ?
|
I still haven't received my replacement HDD from Maxtor, so my browser continually freezes for a few seconds or more regularly due to the HDD problem. As a result, I am running at slow speed right now and playing catchup all over the place...
If you want to work on this tonight, we can if you want. The easiest way to handle this is the same that we handled the color for the Today/Yesterday MOD. So there would need to be changes in both the template cfg and lang_main.php files...
|
|
|
|
|
Back to Top |
|
|
| Re: Mod help - again | |
Posted: 01/13/2006 2:52 AM |
|
|
|
|
Citation |
Posts |
2152 |
Word Cnt. |
78,257 |
BDay |
Jun 15 |
Sign |
Gemini |
Sex |
|
|
|
|
Joined: Apr 22, 2005
Local time: 6:50 AM
Location: Upside down
|
|
|
|
|
|
Ok no worries. I was thinking if it would be worth the while to do it or not.
Might not worry about it |
|
|
|
|
Back to Top |
|
|
| Mod help - again | |
Posted: 01/13/2006 3:37 AM |
|
|
|
|
Site Admin |
Posts |
30756 |
Word Cnt. |
2,628,678 |
BDay |
Jul 28 |
Sign |
Leo |
Sex |
|
|
|
|
Joined: Sep 25, 2004
Local time: 4:50 PM
Location: St Pete, FL
|
|
|
|
|
|
It wouldn't be a big deal to make this change if you still want to do it. You probably would only need to change 4 files total, 3 template cfg files and one language file...
|
|
|
|
|
Back to Top |
|
|
| Information | |
|