vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Admin. 2 Admin. Notes VIA AdminCP Index (https://vborg.vbsupport.ru/showthread.php?t=46221)

TraceyPRO 02-16-2003 07:38 AM

OK, this is my first time here at vBulletin.org so I wanted to make this a good first post :)

I have attached a new anotes.php file which fixes the PHP errors that some of you were having after a note was posted.

Also, I have added an Delete Button Add-On of sorts that a few people were requesting. The delete button will ONLY show up when a message is posted (credit of the PHP code goes to Boofo due to the fact that it's pretty much the same code as his).

In your /admin/index.php file find this:
PHP Code:

maketableheader('Administrator To Administrator Notes');
echo 
"<tr class='".getrowbg()."' valign='top'>\n<td><font size=1><p>"makelinkcode("Leave A Note","./anotes.php","0") ."</p></font></td>\n<td><p></p></td>\n</tr>\n";

$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
$imgcodeon=iif($forum[allowimages],$ontext,$offtext);
$htmlcodeon=iif($forum[allowhtml],$ontext,$offtext);
$smilieson=iif($forum[allowsmilies],$ontext,$offtext);

$notes $DB_site->query_first("SELECT notes,userid,timestamp,username FROM adminnotes LIMIT 1");
$note stripslashes($notes['notes']);
$timestamp $notes['timestamp'];
$userid $notes['userid'];
$author $notes['username'];
$time_posted vbdate('n-j-y, g:i:s a',$timestamp);
makelabelcode($note);
makelabelcode("Author: <a href='$bburl/member.php?s=&action=userinfo&userid=$userid'>$author</a> | Posted On: $time_posted"); 

Replace this chunk of code with:
PHP Code:

$notes $DB_site->query_first("SELECT notes,userid,timestamp,username FROM adminnotes LIMIT 1");
$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
$note stripslashes($notes['notes']);
$timestamp $notes['timestamp'];
$userid $notes['userid'];
$author $notes['username'];
$time_posted vbdate('n-j-y, g:i:s a',$timestamp);

maketableheader('Administrator To Administrator Notes');
echo 
"<tr class='".getrowbg()."' valign='top'>\n<td><font size=1><p>"makelinkcode("Leave A Note","./anotes.php","0") ."";

if ( 
$note != "" ) {
echo 
""makelinkcode("Delete","./anotes.php?action=delete","0") ."";
}
echo 
"</p></font></td>\n<td><p></p></td>\n</tr>\n";

if ( 
$note != "" ) {
makelabelcode($note);
makelabelcode("Author: <a href='$bburl/member.php?s=&action=userinfo&userid=$userid'>$author</a> | Posted: $date_posted at $time_posted");


Once that is done, simply overwrite the original anotes.php file with the altered anotes.php file I attached.

That's it! Once again, this modification/fix should also be partially credited to Boofo for his PHP modification :)

Boofo 02-16-2003 08:29 AM

Excellent addon (with the delete button). Thanks! Try this code and let me know what you think. :)

PHP Code:

// Administrator To Administrator Notes Hack
doformheader("","");
$notes $DB_site->query_first("SELECT notes,userid,timestamp,username FROM adminnotes LIMIT 1");
$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
$imgcodeon=iif($forum[allowimages],$ontext,$offtext);
$htmlcodeon=iif($forum[allowhtml],$ontext,$offtext);
$smilieson=iif($forum[allowsmilies],$ontext,$offtext);
$note stripslashes($notes['notes']);
$timestamp $notes['timestamp'];
$userid $notes['userid'];
$author $notes['username'];
$date_posted vbdate('l, F jS, Y',$timestamp);
$time_posted vbdate('g:i a',$timestamp);

maketableheader('Administrator To Administrator Notes');
echo 
"<tr class='".getrowbg()."' valign='top'>\n<td><font size=1><p>"makelinkcode("Leave A Note","./anotes.php","0") ."";

if ( 
$note != "" ) {
echo 
""makelinkcode("Delete","./anotes.php?action=delete","0") ."";
}
echo 
"</p></font></td>\n<td><p></p></td>\n</tr>\n";

if ( 
$note != "" ) {
makelabelcode($note);
makelabelcode("Author: <a href='$bburl/member.php?s=&action=userinfo&userid=$userid'>$author</a> | Posted: $date_posted at $time_posted");
}
echo 
"</table></td></tr></table></form>\n";
// End of Administrator To Administrator Notes Hack 


TraceyPRO 02-17-2003 05:26 PM

The only problem with the facelift you showed me is that it doesn't seem to work for my AdminCP :( It's odd too, because I'm using vB 2.2.9. But oh well, lol...anywho. I'm back with another bug fix for this. It's a rather small one, but it's a bug none the less.

In /admin/index.php find:
PHP Code:

Author: <a href='$bburl/member.php?s=&action=userinfo&userid=$userid'>$author</a> | Posted On$time_posted 

Replace that with:
PHP Code:

Author: <a href='./user.php?s=$session[sessionhash]&action=edit&userid=$userid'>$author</a> | Posted On$time_posted 

The original code would take you to a blank page when you click on the author's username because the Action 'userinfo' doesn't exist. Well at least it doesn't work on vB 2.2.9 anyway if it does exists, lol.

Also, if you guys are interested I've done a few more add-ons to this great hack. If you would like for me to post them, I would be more then happy to! Thanks!

Boofo 02-18-2003 02:00 AM

That actually should be:

PHP Code:

Author: <a href='$bburl/member.php?s=&action=getinfo&userid=$userid'>$author</a> | Posted On$time_posted 

You really don't want Admins editing Admins profiles. :)

I'd be interested in any other fixes or addons you have.

Poggyuk 03-04-2003 10:53 AM

Can someone help me...
When i ever i leave a note, i always get the following message:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/webn/public_html/forum/admin/db_mysql.php on line 154

Warning: Cannot modify header information - headers already sent by (output started at /home/webn/public_html/forum/admin/adminfunctions.php:19) in /home/webn/public_html/forum/admin/anotes.php on line 34

(But the note i posted, is still shown when you return to the control panel home)

Thanks in advance!

sonic3d 03-04-2003 09:02 PM

just to make sure. is the code suppose to appear on the left side?

l8er
sonic

gmarik 05-24-2003 08:43 AM

Could somebody, please - put it ALL together for 2.3?!

kabresh 07-22-2003 10:56 PM

yeah id like to see this all put together for vb2.3 also :D

shovel 11-17-2005 05:29 AM

Alrighty, I think I'll update it for 2.3.x.
Gimme a couple of days.
Gotta download the software on dial-up. :ninja:


All times are GMT. The time now is 01:42 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.01203 seconds
  • Memory Usage 1,779KB
  • 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
  • (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
  • (9)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