View Full Version : User Notes Icon/Link in Postbit, if user has notes
SFishy
12-30-2004, 10:00 PM
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:
// get first and last post ids for this page (for big reply buttons)
ADD right ABOVE it:
// ###### 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'], true, false);
$show['usernotetotal'] = $usernote['total'];
Save showthread.php
Close and upload.
----- TEMPLATE CHANGE -----
OPEN postbit
FIND:
$post[iplogged]
ADD right BELOW it:
<if condition="(($post['userid'] == $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOWNUSERNOTES) OR ($post[userid] != $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOTHERSUSERNOTES)) AND $show[hasusernote]"> <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
Excellant Hack, simple but useful.
Glad you guys like it --
One thing I just added to the mod .txt file...
----- 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&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]"> <a href="usernote.php?$session[sessionurl]u=$post[userid]"><img class="inlineimg" src="$stylevar[imgdir_button]/notes.gif" alt="$show[usernotetotal]" border="0" /></a> </if>
ttlgDaveh
01-21-2005, 06:23 PM
Nice hack, although I would suggest adding 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:
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.email.php?messageid=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
I'm receiving the same db error as Trackpads...any fix for this?
DR?@M W?@V?R
01-28-2005, 05:49 PM
Great idea! Makes the user notes feature a lot more useful and convenient
yeah I think It makes it more of a option for users to use it, its a great resource, just like a personal guestbook/journal/custom page.
Nice hack very simple but effective.https://vborg.vbsupport.ru/external/2011/01/19.gif
jluerken
01-28-2005, 08:28 PM
I got this whenever someone tried to open a post made by a guest user:
I have USENET import on my site and the posts from the usenet posters are guests.
Thanks,
-Jason
I get the same error. Any news?
i git an db error after i install that hack. :devious:
Datenbankfehler in vBulletin 3.0.6:
Ungueltige SQL-Abfrage:
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
Datum: 31.01.2005 05:02:19
Skript: http://halloo.de/t.php?t=339
Referer: http://halloo.de/f.php?f=45
Benutzername: Hollii
IP-Adresse:
Mystics
02-03-2005, 05:44 PM
i git an db error after i install that hack. :devious:
Replace:// ###### 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'], true, false);
$show['usernotetotal'] = $usernote['total'];with:// ###### MOD display user notes in postbit if user has notes MOD ######
if ($post['userid'])
{
$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'], true, false);
$show['usernotetotal'] = $usernote['total'];
}
else
{
$show['hasusernote'] = false;
$show['usernotetotal'] = 0;
}
Yeah! thats it! :) Thank you, Mystics.// ###### MOD display user notes in postbit if user has notes MOD ######
if ($post['userid'])
{
$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'], true, false);
$show['usernotetotal'] = $usernote['total'];
}
else
{
$show['hasusernote'] = false;
$show['usernotetotal'] = 0;
}
Allan
03-30-2005, 06:45 PM
but one needs a hack which allows creates a note before being able to use your hack !
a hack is needed as that (https://vborg.vbsupport.ru/showthread.php?t=75429) which creates initially a personal note ....
Jolten
03-30-2005, 11:05 PM
but one needs a hack which allows creates a note before being able to use your hack !
a hack is needed as that (https://vborg.vbsupport.ru/showthread.php?t=75429) which creates initially a personal note ....
No it doesn't. It pulls the usernotes if there are any.
Allan
03-31-2005, 05:42 AM
No it doesn't. It pulls the usernotes if there are any.
ok, but how creates usernotes ?
msimplay
04-10-2005, 01:43 PM
A suggestion for this hack is if usernote contains a link to the post the new user note was made from
htscpl
07-29-2005, 11:38 AM
Nice <clicks install>
J82980BA3E43
10-23-2005, 08:07 PM
can Someone help me to make these, so that he does it also for Vbulletin 3.5 gold.
in advance thanks for your work!!
InfidelMatt
11-04-2005, 11:56 PM
Any chance on a vB 3.5.1 update for this? I had it installed in 3.0.7 and would love to have the icon again. I fixed the dropdown menu links, but have yet to figure out how to do the icon.
Razasharp
11-28-2006, 10:10 PM
Does this add a query for each post/user ?
Also, any tried it with 3.6?
tobias_t
04-10-2007, 11:47 PM
I second the request for a version that works in 3.6.5... any chance for this?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.