vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   User Notes Icon/Link in Postbit, if user has notes (https://vborg.vbsupport.ru/showthread.php?t=73534)

SFishy 12-30-2004 10:00 PM

User Notes Icon/Link in Postbit, if user has notes
 
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. https://vborg.vbsupport.ru/

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.

Bison 12-30-2004 10:35 PM

Good job SFishy!

alkatraz 12-31-2004 01:26 AM

Great idea! Makes the user notes feature a lot more useful and convenient

Guest190829 12-31-2004 01:35 AM

Excellant Hack, simple but useful.

SFishy 01-01-2005 01:14 AM

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.

Alien 01-02-2005 04:22 AM

Awesome enhancement, thanks so much!

SnowBot 01-03-2005 02:07 PM

I had this for vb2 :) nice addition.

jmacieira 01-14-2005 09:21 PM

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>

ttlgDaveh 01-21-2005 06:23 PM

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.

trackpads 01-25-2005 02:25 PM

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


All times are GMT. The time now is 06:54 AM.

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.01241 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete