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)
-   -   Quick Edit! -Edit posts directly from within the thread itself (https://vborg.vbsupport.ru/showthread.php?t=54851)

EvilLS1 08-09-2003 02:37 AM

Quote:

Yesterday at 04:01 PM PurpleCow said this in Post #80
Instead of radio button, do u have the image version for this quick edit hack ??

Thank you

Find this:
Code:

<input name="r2" type="radio"  value="" onClick="toggleT('e$post[postid]','s')"><smallfont>QuickEdit</smallfont>
Replace with this:
Code:

<a href="javascript:return false;" onClick="toggleT('e$post[postid]','s')"><img src="http://www.yoursite.com/forums/images/quickedit.gif" border="0"></a>
Change the URL in the code above to the path to your image directory. Then upload the image for the button (name it quickedit.gif). I didn't test it but it should work.

PurpleCow 08-09-2003 04:18 AM

hello,

This works fine, but a minor problem is what i have.

Like, when i click on the image in the post, the window opens up...there the hide radio button is already selected, which should not be so. How can make it so that the Hide option is not selected by default.

Inspite of working fine, it gives me java script erros, how can i avoid showing those java script erros in the status bar.

Thanks for any help.

EvilLS1 08-11-2003 12:47 AM

You could use a regular button instead of the "hide" radio button to solve the problem.

Find this:
Code:

<input name="r2" type="radio" checked value="" onClick="toggleT('e$post[postid]','h')"><smallfont>Hide</smallfont>
Replace it with this:
Code:

<input name="r2" type="button" value="Hide" onClick="toggleT('e$post[postid]','h')">
As for the javascript error, try using this for the image button and maybe it'll fix it.

Code:

<a href="java script:return false;" onClick="toggleT('e$post[postid]','s') return false;"><img src="http://www.yoursite.com/forums/images/quickedit.gif" border="0"></a>

PurpleCow 08-11-2003 12:49 PM

Okay, the Hide problem is solved.

But replacing the new code for image still has problem. When i replace it with the new code in your previous post, and check for the functionality, i get a page not found error when i clcik on the image. Also, when the page load, i get java script errors.

Thanks for any help.

cheers

Quote:

Today at 08:17 AM EvilLS1 said this in Post #83
You could use a regular button instead of the "hide" radio button to solve the problem.

Find this:
Code:

<input name="r2" type="radio" checked value="" onClick="toggleT('e$post[postid]','h')"><smallfont>Hide</smallfont>
Replace it with this:
Code:

<input name="r2" type="button" value="Hide" onClick="toggleT('e$post[postid]','h')">
As for the javascript error, try using this for the image button and maybe it'll fix it.

Code:

<a href="java script:return false;" onClick="toggleT('e$post[postid]','s') return false;"><img src="http://www.yoursite.com/forums/images/quickedit.gif" border="0"></a>


EvilLS1 08-12-2003 09:02 PM

PurpleCow,
My bad, I made a mistake in the code above. Try this instead:
Code:

<a href="java script:return false;" onClick="toggleT('e$post[postid]','s'); return false;"><img src="http://www.yoursite.com/forums/images/quickedit.gif" border="0"></a>
I tested that on my own forum and it works fine.

{edit} I just noticed that the image button version will not work with mozilla type browsers. So if thats what you're using you should stick with the radio button version.

EvilLS1 08-12-2003 10:55 PM

For those who prefer an image button instead of a radio button use these instructions:

Note: Image button version does not work with mozilla browsers!

Also, both versions now have a check box to include the signature.

EvilLS1 08-12-2003 10:56 PM

Screenshot of image button version:

PurpleCow 08-13-2003 02:36 AM

EvilLS1 - Thanks for the zip file. I have a question before, i proceed with the image version installation.

Now, if i want to install image version, do you recommend un-installing the radio button version and then proceed with image version ?? or much of it remains same excepting a few changes ??

And yes, I am using IE6 and not mozilla. I am also testing it on IE6 only.

Quote:

This hack will allow your users to Edit their posts without having to load the editpost page
You had mentioned this in your instructions file. Okay, i guess the radio button version allows only mods and/or admin to quick edit a post, but does this new image version allows even a registered member to edit their post ??

Thank you very much for your valuable time.

EvilLS1 08-13-2003 06:45 PM

The code in functions.php is the same, but you'll need to remove the radio button version's changes to the postbit template and then replace the whole showthread_quickedit template with the html in the instructions above.

Quote:

You had mentioned this in your instructions file. Okay, i guess the radio button version allows only mods and/or admin to quick edit a post, but does this new image version allows even a registered member to edit their post ??
No both versions will allow all registered users to edit their posts via the quick edit feature. You can easily set it up so that only admins and/or mods can use it if you want.

PacknCanes 08-22-2003 02:39 AM

Quick fix for something that screwed up my computer but apparently is sporadic:

Find "<script type=text/javascript> " in your headinclude template and change it to "<script language="JavaScript"> ".

For some reason my computer was processing the text/javascript command as an infinite loop and it caused my CPU usage to skyrocket to 100% and stay there till I loaded another page. Not sure if this will affect anyone else, but if it hit me it may hit someone else, so it's worth a shot to change. No functionality of the hack is changed by editing that line, for the record.

EvilLS1 08-22-2003 08:22 PM

PacknCanes,
Thanks. It doesn't do that on my computer but I'll update the instructions just incase.

Red Blaze 10-07-2003 05:24 PM

Works great! My board's members are quite lazy, as I am too. ^^;

/me installs!

Pickalo 12-19-2003 05:09 AM

Thanks man, this is a great hack and I clicked install :)

EvilLS1 12-20-2003 11:55 PM

Thank you. :)

gmarik 12-21-2003 07:17 AM

Wonder!

jaliam 01-09-2004 07:28 PM

This is a very good hack, guys! Thanks so much.

David Bott 01-16-2004 09:40 PM

Does this not use all the post data twice? I mean...When you pull up the thread with all the posts, does it not have all the post data twice? One for the display and one just in case the QuickEdit is clicked? I mean I like this hack a lot and have it installed, but would it not been nicer to hit the DB if someone clicks on QuickEdit to pull just that posts data when using the feature? Think of the bandwidth increase.

Thanks.

EvilLS1 01-16-2004 11:25 PM

Quote:

Originally Posted by David Bott
Does this not use all the post data twice? I mean...When you pull up the thread with all the posts, does it not have all the post data twice? One for the display and one just in case the QuickEdit is clicked? I mean I like this hack a lot and have it installed, but would it not been nicer to hit the DB if someone clicks on QuickEdit to pull just that posts data when using the feature? Think of the bandwidth increase.

Thanks.

David,
It only loads the text for the person who is viewing his own post, not in all posts. Unless you post a mile long novel it will not be noticible in load times or bandwidth. Its just a few lines of text per thread. A small icon would take longer to load and use more bandwidth.

The Keeper 01-17-2004 03:27 PM

You don't suppose it might be behind these problems, do you?

http://www.vbulletin.com/forum/bugs....iew&bugid=1824

I am pretty certain it's the only change I've made to showthread.

David Bott 01-17-2004 05:01 PM

Thank you kindly. I do see that now. I was set as a admin thus all the posts had the data.

I think I found another bug though. If it has been noticed already, I am sorry but I did not see it.

Issue...If you are subscribed to a thread it will automaitcally unsubscribe you from that thread if you use QuickEdit.

Please advise.

EvilLS1 01-17-2004 05:12 PM

David,
You can add the subscibe option by placing this next to your sig checkbox in the showthread_quickedit template:

Code:

<input type="checkbox" name="email" value="yes" checked><smallfont>subscribe</smallfont>

EvilLS1 01-17-2004 05:13 PM

Quote:

Originally Posted by The Keeper
You don't suppose it might be behind these problems, do you?

http://www.vbulletin.com/forum/bugs....iew&bugid=1824

I am pretty certain it's the only change I've made to showthread.

I don't think so. But try removing the hack and see if the problem goes away.

David Bott 01-17-2004 05:21 PM

That is great...however that just forces the subscribe. Now if they were not and they edit and do not uncheck the box, they are subscribed. I can move it to NO but that gives the reverse issue.

Any way to pull the correct setting?

Thank you.

EvilLS1 01-17-2004 05:24 PM

Quote:

Originally Posted by David Bott
That is great...however that just forces the subscribe. Now if they were not and they edit and do not uncheck the box, they are subscribed. I can move it to NO but that gives the reverse issue.

Any way to pull the correct setting?

Thank you.

Try using this hidden input:
Code:

<input type="hidden" name="email" value="yes" $emailchecked>

David Bott 01-17-2004 05:42 PM

Thanks...sounded good but only made a blank space with the subscribe by default being on or off. That $emailchecked does not seem to have been set.

I also have QUICKREPLY installed and that does use a $emailbox for either "yes" or just a blank based on the users settings. It does work for that area of the page, but if I try to use the same $emailbox in QuickEdit it is always a blank. Stange that I can not use the same setting.

David Bott 01-18-2004 12:51 AM

Hello....If you can find the answer for the above, that would be great for I have to many members now mentioning it.

In case you did not know...AVS Forum and TiVo Community Forum are very active. AVS even at the time of this post has 1245 users on-line. http://www.avsforum.com

Thanks

EvilLS1 01-18-2004 02:08 AM

David,
I wish I could tell you more, but I honestly don't know. I've never noticed this before because I have notifications turned off on my site. My server is down right now but when its back online I'll try a few things to see if I can make it work. If I figure out something I'll let you know.

Dewayne

David Bott 01-18-2004 06:49 AM

Please be so kind to look into it, for I would hate to remove this very nice hack.

David Bott 01-18-2004 03:41 PM

Ok, taking a lead from "Logician" with his UNSUBSCRIBE LINK IF SUBSCRIBED hack...I present the following code for you to look at. More or less it is part of his hack but changed for quickedit. I am thinking it can be put into the /admin/functions.php file right with your hack insert do we get the data needed when the template is called.

The issue however, is when I tried it, it gave me the error....

Fatal error: Call to a member function on a non-object in /home/avsforum/www.avsforum.com/avs-vb/admin/functions.php on line 275


I am thinking it is with the $threadid in the query not being read in and that is something I do not know how to do. Can you help?

Oh...I would use the "$already_subscribed" below (value to be either 'checked' or ' ') to auto check the Subscribe to Thread check box you had made above.

Code:

//QuickEdit Check If Subscribed To Thread
$quickedit_userid=$bbuserinfo['userid'];

if ($quickedit_userid!=0)
{
$user_subscribed_already=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE threadid='$threadid' AND userid='$quickedit_userid' LIMIT 1");
$quickedit_subscribed_id=$user_subscribed_already[subscribethreadid];
if ($quickedit_subscribed_id>0)
{
$already_subscribed='checked';
}
else
{
$already_subscribed='';
}
}
else
{
$already_subscribed='';
}
//QuickEdit Check If Subscribed To Thread

Please help. Thanks

EvilLS1 01-18-2004 08:46 PM

David,

In admin/functions.php find:
Code:

if ($post[username] == $bbuserinfo[username]) {
    $edittext = htmlspecialchars($post[pagetext]);

eval("\$quickedit = \"".gettemplate('showthread_quickedit')."\";");
} else {
$edittext="";
$quickedit="";
}

Replace it with:
Code:

if ($post[username] == $bbuserinfo[username]) {
    $edittext = htmlspecialchars($post[pagetext]);
$subuserid=$post[userid];
$pthreadid=$post[threadid];
if ($subuserid!=0) {
$subscribed=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE threadid='$pthreadid' AND userid='$subuserid' LIMIT 1");
$poop=$subscribed[subscribethreadid];
if ($poop > 0){
$emailchecked="CHECKED";
}else{
$emailchecked="";
}
}

eval("\$quickedit = \"".gettemplate('showthread_quickedit')."\";");
} else {
$edittext="";
$quickedit="";
}

The put this line of code in your showthread_quickedit template:
Code:

<input type="hidden" name="email" value="yes" $emailchecked>

David Bott 01-18-2004 09:12 PM

Thanks for the help.

Sorry...Same error as I was getting.

Fatal error: Call to a member function on a non-object

But your code seems much nicer.

EvilLS1 01-18-2004 09:14 PM

Quote:

Originally Posted by David Bott
Thanks for the help.

Sorry...Same error as I was getting.

Fatal error: Call to a member function on a non-object

But your code seems much nicer.

Thats odd. I tested it on my own forum and its working perfectly. Perhaps its not compatible with some other hack you've installed?

EvilLS1 01-18-2004 09:16 PM

You did remove all of the code that you added earlier right? You could try adding this to a fresh (unhacked) functions.php to see if it works.

David Bott 01-18-2004 09:18 PM

Pondering...Can't see why it would not work, after all, it is just a call to the DB to look up a status and set a value.

Note...I am also using this if it makes a difference...

Code:

if (($bbuserinfo[usergroupid] ==5) || ($bbuserinfo[usergroupid] ==6) || ($bbuserinfo[usergroupid] ==7) or ($post[username] == $bbuserinfo[username])) {
    $edittext = htmlspecialchars($post[pagetext]);


EvilLS1 01-18-2004 09:19 PM

That shouldn't make any difference.

David Bott 01-18-2004 09:22 PM

Code is as such...

Code:

if (($bbuserinfo[usergroupid] ==5) || ($bbuserinfo[usergroupid] ==6) || ($bbuserinfo[usergroupid] ==7) or ($post[username] == $bbuserinfo[username])) {
    $edittext = htmlspecialchars($post[pagetext]);
$subuserid=$post[userid];
$pthreadid=$post[threadid];
if ($subuserid!=0) {
$subscribed=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE threadid='$pthreadid' AND userid='$subuserid' LIMIT 1");
$poop=$subscribed[subscribethreadid];
if ($poop > 0){
$emailchecked="CHECKED";
}else{
$emailchecked="";
}
}

eval("\$quickedit = \"".gettemplate('showthread_quickedit')."\";");
} else {
$edittext="";
$quickedit="";
}

But produces that error like something was not defined.

May I send you my test functions.php file vai e-mail? If so, please be so kind to PM me your address.

EvilLS1 01-18-2004 09:27 PM

Try it on an unhacked functions.php and see what happens..

Also make sure you have the code placed in the right place (above this):

//highlight words for search engine

I'm using 2.2.8 and its working like a champ for me.

David Bott 01-18-2004 09:29 PM

If I did that, some other items would surely fail. :) (That being to put in a fresh functions.php)

David Bott 01-18-2004 09:32 PM

It does not like this line it seems...

Code:

$subscribed=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE threadid='$pthreadid' AND userid='$subuserid' LIMIT 1");
Which is line 274.

EvilLS1 01-18-2004 09:34 PM

Quote:

Originally Posted by David Bott
If I did that, some other items would surely fail. :) (That being to put in a fresh functions.php)

I meant temporarily.. Just to see if it works. ;)


All times are GMT. The time now is 12:51 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.01378 seconds
  • Memory Usage 1,842KB
  • 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
  • (18)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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