FusionBB
Calendar
SMTWTFS
 1234
567891011
12131415161718
19202122232425
2627282930 
September Birthdays
9-21bubazoo
News & Announcements
Online Past 24 Hrs
couchtomatoe , grimdeeper ,
Tagging

Looking for a Modification? It is much easier to view and search for Modifications using our Modification Index.

Username Post: [FINISHED] Beta-[3.0] Newbie Notice v1        (Topic#438)
Stephen 
maximus

Stephen
Post Rank (AVG): 0%
11-26-08 10:22 AM - Post#2832    



Modification / Version: Newbie Notice v1

Description: This puts a notice box on the top of their first post so that new readers don't flame them for something obvious, but to cut them slack and provide them more care, and give them a warm welcome.

Working Under: Fusion 3.0

Modification Status: Beta

Pre-requisites:

Author(s): Stephen

Date: 11/26/08

Credits:

Files Altered: showtopic.php, templates/fusionbb/showto pic_p_row.ph

New Files:

Datebase Altered: no

Instructions / Other Info: in showtopic.php FIND:
Code:

  $template->loadTemplate("showtopic_p_row");  





ADD AFTER:

Code:

      if ($post_data[$i]['info_total_posts'] == 1  ) {             $template->setTemplateVar("NEWBIE","<div align='center' class='color3'><b>This is a new member, and their 1st post!</b></div>");     }  






in templates/fusionbb/showto pic_p_row.php FIND:
Code:

  <td width='90%' valign='top'> <!--EVENT-->  





REPLACE WITH
Code:

  <!--NEWBIE--> <td width='90%' valign='top'> <!--EVENT-->  









Disclaimer:
Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your Fusion code, you may be giving up your right for 'official' support from InteractivePHP, Inc..If you need official support, you'll need to restore unmodified files.


   Attachment


Edited by Stephen on 11-26-08 10:23 AM. Reason for edit: No reason given.
 
Stephen 
maximus

Stephen
Post Rank (AVG): 0%
11-27-08 01:12 AM - Post#2833    


    In response to Stephen

Optionally shows up with five or less posts
Code:

   if ($post_data[$i]['info_total_posts'] <= 5  ) {             $template->setTemplateVar("NEWBIE","<div align='center' class='color3'><b>This is a new member, and their first five posts!</b></div>");     }  





Edited by Stephen on 11-27-08 01:13 AM. Reason for edit: No reason given.
 
couchtomatoe 
Administrator

couchtomatoe
Post Rank (AVG): 0%
12-08-08 01:51 PM - Post#2835    


    In response to Stephen

Thanx
Part Time Code Monkey for FusionBB


 
Stephen 
maximus

Stephen
Post Rank (AVG): 0%
12-18-08 11:49 PM - Post#2838    


    In response to couchtomatoe

This will count the post (1-5) and remain on every members first five posts.

Use this instead of the code i posted above.

You will want to put this into several areas showtopic showtopicforreply recent_activity (when FULL)

Code:

  // --------------------------------------------------------------------------------------------------     //    NEWBIE NOTICE COUNT THE FIRST 5 POSTS     // --------------------------------------------------------------------------------------------------         $sql = "             SELECT p.post_id             FROM ". TABLE_PREFIX ."posts AS p             WHERE p.user_id = ". $post_data[$i]['user_id']. "             ORDER BY p.post_posted ASC             LIMIT 5         ";              if(!$results=$db->executeQuery($sql)) {             dieHere(1,$lang_str['BAD_QUERY'],__LINE__,__FILE__,$sql);         }                  $upid = $db->fetchArray($results);         $db->clearResults($results);                  $upid_array = NULL;                  foreach ($upid as $key => $value) {             $upid_array .= $value['post_id'] .",";         }                  $upid_array = explode (",",$upid_array);              $post_num = '';         $post_name = $post_data[$i]['info_display_name'];                  if($upid_array[0] == $post_data[$i]['post_id'] ){ $post_num = "Welcome $post_name's first post!"; }         if($upid_array[1] == $post_data[$i]['post_id'] ){ $post_num = "This is $post_name's second post."; }         if($upid_array[2] == $post_data[$i]['post_id'] ){ $post_num = "This is $post_name's third post."; }         if($upid_array[3] == $post_data[$i]['post_id'] ){ $post_num = "This is $post_name's fourth post."; }         if($upid_array[4] == $post_data[$i]['post_id'] ){ $post_num = "This is $post_name's fifth post."; }              if (in_array( $post_data[$i]['post_id'] , $upid_array ) ) {             $template->setTemplateVar("NEWBIE","<div align='center' class='color3'><b>$post_num</b></div>");         } else {             $template->setTemplateVar("NEWBIE","");         }           





Edited by Stephen on 12-18-08 11:51 PM. Reason for edit: No reason given.
 
Monkeyra 
maximus

Monkeyra
Post Rank (AVG): 0%
01-06-09 09:01 PM - Post#2839    


    In response to Stephen

Neat one

www.fordmondeo.org
www.stdrivers.co.uk


 
ldraper 
newbie

Post Rank (AVG): 0%
01-15-09 04:51 PM - Post#2840    


    In response to Monkeyra

That's an excellent idea, Stephen. Thanks!
 
Spiritburner 
newbie

Post Rank (AVG): 0%
07-25-10 02:09 PM - Post#2969    


    In response to ldraper

Does this work on 3.1?

I tried & got a db error:
Code:

 Invalid QueryFile: /home/spiritb1/public_html/fusion/showtopic.php Line3041 SQL ErrorYou have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.post_posted ASC LIMIT 5' at line 4 SQL Error #: 1064 SQL Query: SELECT p.post_id FROM fbb_posts AS p WHERE p.user_id = ORDER BY p.post_posted ASC LIMIT 5  






Does this need to go into the template files as well?
 
Icon Legend Permissions & Sharing Options Topic Options
Print Topic


2031 Views
Shout Box
Current Weather

Enter a city or zip code:

FusionBB™ Version 3.2 Alpha 1 | ©2003-2020 InteractivePHP, Inc.
Execution time: 0.136 seconds.   Total Queries: 123   Zlib Compression is on.
All times are (GMT+1). Current time is 08:59 PM
Top