Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
User Notes Icon/Link in Postbit, if user has notes Details »»
User Notes Icon/Link in Postbit, if user has notes
Version: 1.00, by SFishy SFishy is offline
Developer Last Online: Dec 2012 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-30-2004 Last Update: Never Installs: 21
 
No support by the author.

Description:
This modification adds an icon and link to a member's usernotes in the postbit template. The icon will only appear to the people with proper permissions for viewing notes. The icon will only appear IF the member actually has usernotes posted about them. Icon links directly to that member's notes. Rolling over the icon reveals the number of notes a member has posted about them.

Time to install: 5 minutes or less.

Files to Modify: 1 php file, 1 template.

Graphic included.

- - - - -

------ FILE CHANGE -------

OPEN showthread.php

FIND:

PHP Code:
        // get first and last post ids for this page (for big reply buttons) 
ADD right ABOVE it:

PHP Code:
   // ###### MOD display user notes in postbit if user has notes MOD ######
    
$usernote $DB_site->query_first("
        SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
        FROM " 
TABLE_PREFIX "usernote AS usernote
        WHERE userid = 
$post[userid]
    "
);
    
$show['hasusernote'] = iif($usernote['total'], truefalse);
    
$show['usernotetotal'] = $usernote['total']; 
Save showthread.php
Close and upload.


----- TEMPLATE CHANGE -----

OPEN postbit

FIND:

PHP Code:
            $post[iplogged
ADD right BELOW it:

PHP Code:
            <if condition="(($post['userid'] == $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOWNUSERNOTES) OR ($post[userid] != $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOTHERSUSERNOTES)) AND $show[hasusernote]">&nbsp;<a href="usernote.php?$session[sessionurl]u=$post[userid]"><img src="images/buttons/notes.gif" border=0 alt="$show[usernotetotal]"></a></if> 
Save changes.


----- ADDITIONAL IMAGE UPLOAD -----

Use provided notes.gif image, or make your own.

UPLOAD into directory images/buttons (or other appropriate image directory of your choosing).

If you upload into a different directory, be sure to change the IMG SRC code in postbit to refer to the correct place.


That's it, you're done.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-30-2004, 10:35 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good job SFishy!
Reply With Quote
  #3  
Old 12-31-2004, 01:26 AM
alkatraz alkatraz is offline
 
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 384
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great idea! Makes the user notes feature a lot more useful and convenient
Reply With Quote
  #4  
Old 12-31-2004, 01:35 AM
Guest190829
Guest
 
Posts: n/a
Default

Excellant Hack, simple but useful.
Reply With Quote
  #5  
Old 01-01-2005, 01:14 AM
SFishy SFishy is offline
 
Join Date: Nov 2001
Location: NY
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pseudo class
Excellant Hack, simple but useful.
Glad you guys like it --
One thing I just added to the mod .txt file...

PHP Code:
----- OPTIONAL TEMPLATE CHANGE -----

If 
you want "Post Usernote About MemberX" to appear in the postbit user dropdown.  Will ONLY appear for people who have permission to add/view notes.

OPEN postbit (or postbit_legacy)

FIND:

         
$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
    </if>
    
ADD right BELOW it:

    <if 
condition="(($post['userid'] == $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOWNUSERNOTES) OR ($post[userid] != $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOTHERSUSERNOTES))"><tr><td class="vbmenu_option"><a href="usernote.php?$session[sessionurl]do=newnote&amp;u=$post[userid]">Post Usernote About $post[username]</a></td></tr>
    </if>
    
Save changes
Just makes it's easier to immediately select to post usernotes about a member.
Reply With Quote
  #6  
Old 01-02-2005, 04:22 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome enhancement, thanks so much!
Reply With Quote
  #7  
Old 01-03-2005, 02:07 PM
SnowBot's Avatar
SnowBot SnowBot is offline
 
Join Date: Jul 2003
Location: Manchester UK
Posts: 631
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had this for vb2 nice addition.
Reply With Quote
  #8  
Old 01-14-2005, 09:21 PM
jmacieira's Avatar
jmacieira jmacieira is offline
 
Join Date: Sep 2004
Location: Portugal
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice i instalade

but i correct the center gif

<if condition="(($post['userid'] == $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOWNUSERNOTES) OR ($post[userid] != $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOTHERSUSERNOTES)) AND $show[hasusernote]">&nbsp;<a href="usernote.php?$session[sessionurl]u=$post[userid]"><img class="inlineimg" src="$stylevar[imgdir_button]/notes.gif" alt="$show[usernotetotal]" border="0" /></a> &nbsp;</if>
Reply With Quote
  #9  
Old 01-21-2005, 06:23 PM
ttlgDaveh's Avatar
ttlgDaveh ttlgDaveh is offline
 
Join Date: Dec 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack, although I would suggest adding
PHP Code:
if($post[userid] !=''
around the query as you get nice DB errors if you have any posts without userids, as happened to me in a botched upgrade from one forum software to another several years ago.
Reply With Quote
  #10  
Old 01-25-2005, 02:25 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got this whenever someone tried to open a post made by a guest user:


Quote:
Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
FROM usernote AS usernote
WHERE userid =

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

mysql error number: 1064

Date: Tuesday 25th of January 2005 08:19:27 AM
Script: http://www.trackpads.com/forum/showthread.php?t=83928
Referer: http://www.trackpads.com/mail/read.e...69710&show=msg
Username: Hannibal
IP Address: 68.18.124.54
I have USENET import on my site and the posts from the usenet posters are guests.

Thanks,

-Jason
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04436 seconds
  • Memory Usage 2,311KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete