[BETA] Colored link if new post

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
User avatar
DaMnY
Registered User
Posts: 51
Joined: Sun Jan 26, 2003 10:09 am
Location: The Netherlands
Contact:

[BETA] Colored link if new post

Post by DaMnY »

Colored link if new post
Changes the color of the links if there are new posts

Screenshot index:
Image

Screenshot viewforum:
Image

Topic @ phpBB.nl: http://www.phpbb.nl/viewtopic.php?t=14451

Code: Select all

############################################################## 
## MOD Title: Colored link if new post
## MOD Author: DaMnNaTiOn < fy [at] frankyang [dot] net > (Frank Yang) http://www.frankyang.net 
## MOD Description: Changes the color of the links if there are new posts
## MOD Version: 0.2.0
## 
## Installation Level: Easy
## Installation Time: 5 Minutes 
## Files To Edit: index.php
##                viewforum.php
##                templates/subSilver/index_body.tpl
##                templates/subSilver/viewforum_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: Nothing :) 
############################################################## 
## MOD History: 
## 
##   2005-11-20 - Version 0.2.0 
##      - Added the link highlighting in viewforum.php
##
##   2005-11-19 - Version 0.1.1 
##      - Simplified the install, the color is now hardcoded in the php file instead of the css file
##
##   2004-11-26 - Version 0.1.0 
##      - Initial Release
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
# 
#-----[ OPEN ]------------------------------------------ 
#

index.php

# 
#-----[ FIND ]------------------------------------------ 
#

$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
# Change #d82929 to any color you like

$new_posts_link = ( $unread_topics ) ? ' style="color: #d82929;"' : '';

# 
#-----[ FIND ]------------------------------------------ 
#

'ROW_CLASS' => $row_class,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

'NEW_POSTS_LINK' => $new_posts_link,

# 
#-----[ OPEN ]------------------------------------------ 
#

viewforum.php

# 
#-----[ FIND ]------------------------------------------ 
#

$folder_image = $folder_new;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
# Change #d82929 to any color you like

$new_posts_link = ' style="color: #d82929;"';

# 
#-----[ FIND ]------------------------------------------ 
#

$folder_image = $folder_new;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

$new_posts_link = ' style="color: #d82929;"';

# 
#-----[ FIND ]------------------------------------------ 
#

'ROW_CLASS' => $row_class,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

'NEW_POSTS_LINK' => $new_posts_link,

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/subSilver/index_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
#

<td class="row1" width="100%" height="50">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#

<span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a>

# 
#-----[ IN-LINE REPLACE WITH ]------------------------------------------ 
#

<span{catrow.forumrow.NEW_POSTS_LINK} class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a>

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/subSilver/viewforum_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
#

<span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#

{topicrow.U_VIEW_TOPIC}"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

{topicrow.NEW_POSTS_LINK}

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Last edited by DaMnY on Mon Nov 21, 2005 4:11 pm, edited 7 times in total.
Know Thyself
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron
Contact:

Post by stickerboy »

Looks good :)
I'll test this out and let you know how it does
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo »

Good MOD. I look forward to implementing this later when I've figured out a problem on my forum.
I write articles on community building
@ The Infinity Program.
User avatar
DaMnY
Registered User
Posts: 51
Joined: Sun Jan 26, 2003 10:09 am
Location: The Netherlands
Contact:

Post by DaMnY »

*bump*
I've added the highlighting in viewforum.php
Still looking for a better solution, the hardcoded color in the php files isn't really neat.
Know Thyself
User avatar
*=Matt=*
Registered User
Posts: 389
Joined: Mon Dec 20, 2004 11:56 pm
Location: Oakdale, Wisconsin

Post by *=Matt=* »

You know what you be great with this mod. If you make it so that the colors can be editable in the theme page. like instead of the color code use $theme['newest_post'] or something like that. It would be alittle more work but beside that im going to test this on my forums.
User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit »

Hello,

Could you please change your MODs version number as outlined in MOD Development forum rules section 2. Your MOD as being in development requires a development version number as stated in the phpBB versioning scheme.

For example if your MOD is currently displaying v1.0.0, you can change it to 0.1.0 or 1.1.0, depending on your feelings of it's development status. Even minor version numbers (y of x.y.z) are reserved for release versions. If you believe your MOD is of a quality that deserves a release version, please do not hesitate to submit your MOD to the phpBB.com MODDB (MOD release database) for validation pending release.

Thank you,
The phpBB MOD Team
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."
User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers »

DaMnY wrote: *bump*
I've added the highlighting in viewforum.php
Still looking for a better solution, the hardcoded color in the php files isn't really neat.


An option I'd like to see is the ability to use a small graphic instead of changing the color. I could add a little "New" image, for example.
miccom
Registered User
Posts: 129
Joined: Mon Aug 26, 2002 2:56 pm
Location: Germany - Hamburg
Contact:

Post by miccom »

thats it, what i'm searching for! :D

only a suggestion for this mod:
there are allready classes for this links, the are called "forumlink" and "topictitle" and maybe it is a better way to add a prefix/suffix to this classname like "forumlink-new" and "topictitle-new". instead of putting a class-definition into a php-file. and u can use different color on different styles.

i think, that is also the way the realised it here:
www.phpbbxs.com (a premodded phpbb)

pls keep up the work on this mod!
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

made a few adjustments

Code: Select all

############################################################## 
## MOD Title: Colored link if new post 
## MOD Author: DaMnNaTiOn < fy [at] frankyang [dot] net > (Frank Yang) http://www.frankyang.net 
## MOD Author: Mickroz < mickroz [at] mickroz [dot] nl > (Mike Kros) http://www.mickroz.nl 
## MOD Description: Changes the color of the links if there are new posts 
## MOD Version: 0.2.1 
## 
## Installation Level: Easy 
## Installation Time: 10 minutes 
## Files To Edit: index.php 
##                viewforum.php 
##                templates/subSilver/index_body.tpl 
##                templates/subSilver/viewforum_body.tpl 
##                language/lang_english/lang_main.php 
## Included Files: 
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
## Generator: MOD Studio [ ModTemplateTools 1.0.2232.38226 ] 
############################################################## 
## 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: Nothing :) 
############################################################## 
## MOD History: 
## 
## 2006-02-15 - Version 0.2.1 
## - Fixed link colors not working. 
##   Added $lang['Link_color'] for easy color change. 
## 
## 2005-11-20 - Version 0.2.0 
## - Added the link highlighting in viewforum.php 
## 
## 2005-11-19 - Version 0.1.1 
## - Simplified the install, the color is now hardcoded in the php file instead of the css file 
## 
## 2004-11-26 - Version 0.1.0 
## - Initial Release 
## 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 

index.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$new_posts_link = ( $unread_topics ) ? ' style="color: ' . $lang['Link_color'] . ';"' : ''; 

# 
#-----[ FIND ]------------------------------------------ 
# 

'ROW_CLASS' => $row_class, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

'NEW_POSTS_LINK' => $new_posts_link, 

# 
#-----[ OPEN ]------------------------------------------ 
# 

viewforum.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$folder_image = $folder_new; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$new_posts_link = ' style="color: ' . $lang['Link_color'] . ';"'; 

# 
#-----[ FIND ]------------------------------------------ 
# 

$folder_image = $folder; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$new_posts_link = ''; 

# 
#-----[ FIND ]------------------------------------------ 
# 

$folder_image = $folder_new; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$new_posts_link = ' style="color: ' . $lang['Link_color'] . ';"'; 

# 
#-----[ FIND ]------------------------------------------ 
# 

$folder_image = $folder; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$newest_post_img = ''; 

# 
#-----[ FIND ]------------------------------------------ 
# 

$folder_image = $folder; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$new_posts_link = ''; 

# 
#-----[ FIND ]------------------------------------------ 
# 

'ROW_CLASS' => $row_class, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

'NEW_POSTS_LINK' => $new_posts_link, 

# 
#-----[ OPEN ]------------------------------------------ 
# 

templates/subSilver/index_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

<td class="row1" width="100%" height="50"> 

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

<span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a> 

# 
#-----[ IN-LINE REPLACE WITH ]------------------------------------------ 
# 

<span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}"{catrow.forumrow.NEW_POSTS_LINK}>{catrow.forumrow.FORUM_NAME}</a> 

# 
#-----[ OPEN ]------------------------------------------ 
# 

templates/subSilver/viewforum_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

<span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href=" 

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

{topicrow.U_VIEW_TOPIC}" 

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 

{topicrow.NEW_POSTS_LINK} 

# 
#-----[ OPEN ]------------------------------------------ 
# 

language/lang_english/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

// 
// That's all Folks! 
// ------------------------------------------------- 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
# Change #d82929 to any color you like 

//Colored Link if new post MOD 
$lang['Link_color'] = '#d82929'; 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

Code: Select all

##############################################################
## MOD Title: Colored link if new post
## MOD Author: DaMnNaTiOn < fy [at] frankyang [dot] net > (Frank Yang) http://www.frankyang.net
## MOD Author: Mickroz < mickroz [at] mickroz [dot] nl > (Mike Kros) http://www.mickroz.nl
## MOD Description: Changes the color of the links if there are new posts
## MOD Version: 0.2.2
## 
## Installation Level: Easy
## Installation Time: 10 minutes
## Files To Edit: admin/admin_board.php
##		  index.php
##                viewforum.php
##		  templates/subSilver/admin/board_config_body.tpl
##                templates/subSilver/index_body.tpl
##                templates/subSilver/viewforum_body.tpl
##                language/lang_english/lang_admin.php
## 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:
##		You can run db_update.php or do the sql
##		commands manually. 
##############################################################
## MOD History:
##
## 2007-01-23 - Version 0.2.2
## - Fixed typo in install file.
##   Added ACP field for easy color change.
##   Created update file and db_update.php.
##
## 2006-02-15 - Version 0.2.1
## - Fixed link colors not working.
##   Added $lang['Link_color'] for easy color change.
## 
## 2005-11-20 - Version 0.2.0
## - Added the link highlighting in viewforum.php 
## 
## 2005-11-19 - Version 0.1.1
## - Simplified the install, the color is now hardcoded in the php file instead of the css file 
## 
## 2004-11-26 - Version 0.1.0
## - Initial Release 
## 
## 
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
download here

if you made the adjustments i posted above there is a update file for it.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Post by RMcGirr83 »

The color of the link should be specific to whichever theme you are using. The way the mod is written now the color of the link is stored in the board configuration...meaning if you have more than one template and apply the tpl edits the color will be the same for each template.
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

true, this is based on having one theme on your forum...
User avatar
kber
Registered User
Posts: 986
Joined: Sun May 07, 2006 9:22 am
Location: Egypt
Contact:

Post by kber »

a very nice mod :)
Hello All
Post Reply

Return to “[2.0.x] MODs in Development”