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)
-   -   vBpad - Your personal notepad! (v1.0) (https://vborg.vbsupport.ru/showthread.php?t=29760)

Admin 10-06-2001 10:00 PM

This will add a speical section to the User CP, called "My vBpad".

Started a reply but don't have time to finish it?
Need to save a certain sentence you use a lot? (*cough*)
Just put it there, and hit save!

Each pad can store multiple notes. Maximum number of notes can be set in the Admin CP.
You can also allow/disallow use of IMG code, vB code, smilies and HTML in notes.
Also storing the last time the pad was changed.

I was hoping that I could get fedback from you guys, and maybe turn this into something a lot better
So if you got any ideas, how this can be used to make life easier on a forum, please do not hesitate.

Screen shots:
https://vborg.vbsupport.ru/attachmen...&postid=182455
https://vborg.vbsupport.ru/attachmen...&postid=182457
https://vborg.vbsupport.ru/attachmen...&postid=182891

Read tubedogg's thread here for more info about running queries.

Installer: (upload to your admin folder and run)
https://vborg.vbsupport.ru/attachmen...&postid=182964

orca 10-07-2001 11:05 AM

Wow, a great hack again. May I gonna try it later on my home PC since I don't need it on my server (yet).

Admin 10-07-2001 11:32 AM

Thanks orca.

Here is a screen shot of the main thing - for now, the only thing.
But I'm already working on a little add-on... :)

Admin 10-07-2001 11:56 AM

Figured it's a waste of time to navigate thru the User Control Panel just to read the notes, so I added this.
(screen shot attached)

Will update first post in a couple of minutes.

chrispadfield 10-07-2001 12:15 PM

this is a great plan, until now i have sent pms to myself ;)

the next feature would be able to have more than one notepad per person and an admin option to set the limit.

cool hack :)

maverick1236 10-07-2001 04:59 PM

WELL DONE FIREFLY!!!!!!!!!!

THANK YOU!!!:D

Admin 10-07-2001 05:30 PM

Wait, it gets better.
I added a couple of new features:
Now with support for multiple notes.
Admin can set max number of notes a user can have, and max chars for each note.
I just need to fix a few things and I'll release it.

Until then I remove the code from my first post to avoid too many people installing an old version. :)

MarkB 10-07-2001 11:15 PM

Brilliant! I look forward to the release :)

hacker 10-08-2001 05:15 AM

GREAT HACK AGAIN FROM FIREFLY!!

Now, shouldn't it be just called vB Pad or My vB Pad instead of Your vBPad to be consistent :)?

Admin 10-08-2001 07:23 AM

Thanks hacker, I'll edit the templates.
(the reason I added "Your" there is because just vBpad looked small :p)
So I'll make everything "My vB Pad". (can someone edit the thread title for me? thank you!)

tubedogg 10-08-2001 07:54 AM

Keep in mind that $usercpnav is pretty wide as it is...Kier and I spent some time a few months back trying to fit a new link on it (and keep it fitting within 800x600) and it wasn't fun. :)

Admin 10-08-2001 08:01 AM

Then I think I'll remove the link from the navigation, and just link to that page from that box that shows the notes.
You don't happen to know if it's possible to add something like maxlength="xx" to <textarea>, do you?
I don't want to add Javascripts... ;(

kamrad.ru 10-08-2001 08:54 AM

I`m I want it :D

Admin 10-08-2001 09:04 AM

In a couple of minutes (really!).

Admin 10-08-2001 09:15 AM

Ok, it's done.

I added a lot of stuff, you can see everything by the screenshots I posted:
Main thing - http://www.vbulletin.com/forum/attac...&postid=182455
User control panel - http://www.vbulletin.com/forum/attac...&postid=182457
Admin options - http://www.vbulletin.com/forum/attac...&postid=182891

webhost 10-08-2001 10:28 AM

All works but the box does not show up to place notes in, a box comes up that has the following information in it
"Your notes:
Last updated: 10-08-2001 06:15 AM
You are allowed to have 10 notes, each can contain 250 characters
IMG code is , vB code is , smilies are , HTML is "

and says update my pad at bottom. When you click on update pad it gives you this error and then automaically goes back to the user profile.
warning varaiable passed to each () is not a array or an object at home/blab/blab/blab
on line 536

line 536 is this

PHP Code:

  while (list($key,$val)=each($notes)) { 

I have ran queries and they look correct in database, also went into control panel set all vb pad options to yes and saved, and also updated all counters/
Any Ideas?

kamrad.ru 10-08-2001 10:37 AM

Database vbulletin
Error
SQL-query : [Edit]

INSERT INTO settinggroup (settinggroupid,title,displayorder) VALUES ('40','vBpad','32')

MySQL said: Duplicate entry '40' for key 1

Back

webhost 10-08-2001 10:42 AM

Did you install his first version, if so that might already be installed in that table. That is the reason you are getting the error, I got that error also but when i looked in the table it was there, so i went on with the install.

Admin 10-08-2001 11:43 AM

kamrad.ru, run this query and attach a screen shot of what you get (don't worry, no private info will be displayed):
Code:

SELECT * FROM settinggroup WHERE settinggroupid>'30'
OR PM me with access to phpMyAdmin and I will install this for you.

Webhost, very strange.
I thought it's a problem when the table is empty, but I already ruled that possibility out.
Are you sure you created the table?

Anyway, I updated the first post. Updated part is the code for member2.php.

shadowbreed 10-08-2001 12:07 PM

The pad works fine now, but nothing shows up on the My Vb Home page

Admin 10-08-2001 12:10 PM

Nothing at all?
Then you either didn't add the code to usercp.php, or didn't create the templates usercp_mininotepad and usercp_mininotepad_bit.

shadowbreed 10-08-2001 12:15 PM

oops,
i actually did all the changes but somehow it kept the old usercp.php in stead of the changed one, sorry to waste your time

GREAT HACK!!!

hacker 10-08-2001 12:29 PM

Quote:

Originally posted by tubedogg
Keep in mind that $usercpnav is pretty wide as it is...Kier and I spent some time a few months back trying to fit a new link on it (and keep it fitting within 800x600) and it wasn't fun. :)
Maybe that can be kept shorter: All the Edit xxx is really redundant. Edit is not really needed as it is understaood. If so, vB Pad is sufficient instead of My vB Pad.

Dontom 10-08-2001 01:21 PM

Installation was easy - thank you for this great hack!!!
Tom

Admin 10-08-2001 01:51 PM

Installer:

(couldn't post any more in my post because I was over the max-chars limit! :eek:)

BradC 10-08-2001 02:00 PM

Great idea and great addon, I am going to install it on a dev board here in a bit before my college class :)

thanks FireFly :)

Steve Machol 10-08-2001 03:06 PM

Another excellent hack FireFly! :)

I have one question. How difficult would this be to limit to specific user groups? For instance, I am going to create a 'Premier Member' program for those people who donate to my site and something like this would be perfect as an added-on benefit for contributors.

poil11 10-08-2001 03:11 PM

i don't know if there is such a need for multiple notes fields. i think one semi large field would be fine. i don't know, because people can just add there notes into the one main one. either way i like the idea for notes. on newpost, or newreply or whatever, there should be a link directly to go to your notes. or an option in the cp to display your notes on those pages. i like how yu used my post for testing.

kamrad.ru 10-08-2001 03:27 PM

All work`s it`s realy COOL, thanks :)

Justice 10-08-2001 07:31 PM

great job FireFly

Also, I feel the same way as smachol, about the user groups...

SirFaraz Khan 10-08-2001 09:07 PM

when i run install_vbpad.php, it gives me this message:

Fatal error: Call to undefined function: cpheader() in /home/411hype/public_html/forums/install_vbpad.php on line 15

MarkB 10-08-2001 09:28 PM

Just installed it! Thanks, it went flawlessly :)

- although, in the installer, it's a little confusing when it comes to editing the usercp template, as you actually need to edit usercp_nav to add in

Code:

<td bgcolor="$cpnav[8]">
<smallfont><b><a href="member2.php?s=$session[sessionhash]&action=notepad">My vBpad</a></b></smallfont>
</td>

not usercp itself...

Mind you, I'm easily confused :p

SirFaraz Khan 10-08-2001 11:43 PM

nobody can solve my problem?!
When i run the install file, the following error comes up!...

Fatal error: Call to undefined function: cpheader() in /home/411hype/public_html/forums/install_vbpad.php on line 15

tubedogg 10-09-2001 12:40 AM

You need to put that file in your /admin directory to run it.

Also, please enter your license information in your profile. See the link in my sig for more info. Thanks!

Admin 10-09-2001 08:12 AM

Yup, sorry I didn't write it in my post.

MarkB, thanks for that, I'll fix it right away. :)

Steve, yeah it's very possible. Give me a couple of hours and I'll get to it. :)

Admin 10-09-2001 08:56 AM

Alright Steve, Justice, here it is.
Works great as far as I tested it.

(by default, all usergroups have this DISABLED!)

ADDON: Make vBpad available only to certain usergroups, based on settings in Admin CP

Run query:
Code:

ALTER TABLE usergroup ADD cannotepad SMALLINT(6) DEFAULT '0' not null AFTER canwhosonlineip
Changes to file usergroup.php (admin folder):
Add:
PHP Code:

  maketableheader("My vBpad Permissions");
  
makeyesnocode("Can Use vBpad","cannotepad",1); 

right after:
PHP Code:

  makeyesnocode("Can View IP Addresses on Who's Online","canwhosonlineip",0); 

Replace:
PHP Code:

  $DB_site->query("INSERT INTO usergroup (usergroupid,title,usertitle,cancontrolpanel,canmodifyprofile,canviewmembers,canview,cansearch,canemail,canpostnew,canmove,canopenclose,candeletethread,canreplyown,canreplyothers,canviewothers,caneditpost,candeletepost,canusepm,canpostpoll,canvote,canpostattachment,ismoderator,canpublicevent,canpublicedit,canthreadrate,cantrackpm,candenypmreceipts,maxbuddypm,maxforwardpm,canwhosonline,canwhosonlineip)
    VALUES (NULL,'"
.addslashes($title)."','".addslashes($usertitle)."',$cancontrolpanel,$canmodifyprofile,$canviewmembers,$canview,$cansearch,$canemail,$canpostnew,$canmove,$canopenclose,$candeletethread,$canreplyown,$canreplyothers,$canviewothers,$caneditpost,$candeletepost,$canusepm,$canpostpoll,$canvote,$canpostattachment,$ismoderator,$canpublicevent,$canpublicedit,$canthreadrate,$cantrackpm,$candenypmreceipts,$maxbuddypm,$maxforwardpm,$canwhosonline,$canwhosonlineip)"); 

with:
PHP Code:

  $DB_site->query("INSERT INTO usergroup (usergroupid,title,usertitle,cancontrolpanel,canmodifyprofile,canviewmembers,canview,cansearch,canemail,canpostnew,canmove,canopenclose,candeletethread,canreplyown,canreplyothers,canviewothers,caneditpost,candeletepost,canusepm,canpostpoll,canvote,canpostattachment,ismoderator,canpublicevent,canpublicedit,canthreadrate,cantrackpm,candenypmreceipts,maxbuddypm,maxforwardpm,canwhosonline,canwhosonlineip,cannotepad)
    VALUES (NULL,'"
.addslashes($title)."','".addslashes($usertitle)."',$cancontrolpanel,$canmodifyprofile,$canviewmembers,$canview,$cansearch,$canemail,$canpostnew,$canmove,$canopenclose,$candeletethread,$canreplyown,$canreplyothers,$canviewothers,$caneditpost,$candeletepost,$canusepm,$canpostpoll,$canvote,$canpostattachment,$ismoderator,$canpublicevent,$canpublicedit,$canthreadrate,$cantrackpm,$candenypmreceipts,$maxbuddypm,$maxforwardpm,$canwhosonline,$canwhosonlineip,$cannotepad)"); 

Add:
PHP Code:

  maketableheader("My vBpad Permissions");
  
makeyesnocode("Can Use vBpad","cannotepad",$usergroup[cannotepad]); 

right after:
PHP Code:

  makeyesnocode("Can View IP Addresses on Who's Online","canwhosonlineip",$usergroup[canwhosonlineip]); 

Replace:
PHP Code:

  $DB_site->query("UPDATE usergroup SET title='".addslashes($title)."',usertitle='".addslashes($usertitle)."',cancontrolpanel=$cancontrolpanel,canmodifyprofile=$canmodifyprofile,canviewmembers=$canviewmembers,canview=$canview,cansearch=$cansearch,canemail=$canemail,canpostnew=$canpostnew,canmove=$canmove,canopenclose=$canopenclose,candeletethread=$candeletethread,canreplyown=$canreplyown,canreplyothers=$canreplyothers,canviewothers=$canviewothers,caneditpost=$caneditpost,candeletepost=$candeletepost,canusepm=$canusepm,canpostpoll=$canpostpoll,canvote=$canvote,canpostattachment=$canpostattachment,ismoderator=$ismoderator,canpublicedit=$canpublicedit,canpublicevent=$canpublicevent,canthreadrate=$canthreadrate,cantrackpm=$cantrackpm,candenypmreceipts=$candenypmreceipts,maxbuddypm=$maxbuddypm,maxforwardpm=$maxforwardpm,canwhosonline=$canwhosonline,canwhosonlineip=$canwhosonlineip WHERE usergroupid=$usergroupid"); 

with:
PHP Code:

  $DB_site->query("UPDATE usergroup SET title='".addslashes($title)."',usertitle='".addslashes($usertitle)."',cancontrolpanel=$cancontrolpanel,canmodifyprofile=$canmodifyprofile,canviewmembers=$canviewmembers,canview=$canview,cansearch=$cansearch,canemail=$canemail,canpostnew=$canpostnew,canmove=$canmove,canopenclose=$canopenclose,candeletethread=$candeletethread,canreplyown=$canreplyown,canreplyothers=$canreplyothers,canviewothers=$canviewothers,caneditpost=$caneditpost,candeletepost=$candeletepost,canusepm=$canusepm,canpostpoll=$canpostpoll,canvote=$canvote,canpostattachment=$canpostattachment,ismoderator=$ismoderator,canpublicedit=$canpublicedit,canpublicevent=$canpublicevent,canthreadrate=$canthreadrate,cantrackpm=$cantrackpm,candenypmreceipts=$candenypmreceipts,maxbuddypm=$maxbuddypm,maxforwardpm=$maxforwardpm,canwhosonline=$canwhosonline,canwhosonlineip=$canwhosonlineip,cannotepad=$cannotepad WHERE usergroupid=$usergroupid"); 

Changes to file member2.php (admin folder):
Add:
PHP Code:

  $usergroupdef getpermissions(0,-1,$bbuserinfo['usergroupid']);
  if (!
$usergroupdef['cannotepad']) {
    
show_nopermission();
  } 

right before:
PHP Code:

  $allnotes=""

(two times)

Changes to file usercp.php (admin folder):
Replace:
PHP Code:

$padbits="";
$counter=1

with:
PHP Code:

$usergroupdef getpermissions(0,-1,$bbuserinfo['usergroupid']);
if (
$usergroupdef['cannotepad']) {
$padbits="";
$counter=1

Replace:
PHP Code:

eval("\$vbpad = \"".gettemplate("usercp_mininotepad")."\";"); 

with:
PHP Code:

eval("\$vbpad = \"".gettemplate("usercp_mininotepad")."\";");
} else {
$vbpad="";



certify 10-09-2001 09:59 AM

Excellent hack, well done! :)

magistr 10-09-2001 10:51 AM

very easy install
cool thanx

Admin 10-09-2001 02:14 PM

magistr, glad you liked it! :)
Can you please enter your license information in your profile. See the link in my sig for more info. Thanks!

Admin 10-09-2001 02:33 PM

Found a little (big) bug:
In member2.php, this code
Code:

    if ($maxpadnum!=0 and $counter<=$maxpadnum) {
should be like this:
Code:

    if ($maxpadnum==0 or $counter<=$maxpadnum) {
Updated the installer, but if you already installed this then you should do this change yourself. :)


All times are GMT. The time now is 04:47 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.01656 seconds
  • Memory Usage 1,873KB
  • 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
  • (5)bbcode_code_printable
  • (15)bbcode_php_printable
  • (1)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
  • (40)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