[ABD] AJAX Quick Edit

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
LDsix
Registered User
Posts: 20
Joined: Fri Sep 01, 2006 2:36 pm

Re: [DEV] AJAX Quick Edit

Post by LDsix »

yes, it works.
Spiderman92
I've Been Banned!
Posts: 175
Joined: Thu Jan 03, 2008 9:35 pm

Re: [DEV] AJAX Quick Edit

Post by Spiderman92 »

I get and error when i click on it saying "CAnt handle Request"

wtf?
Mandarola
Registered User
Posts: 245
Joined: Tue Sep 25, 2007 3:21 am

Re: [DEV] AJAX Quick Edit

Post by Mandarola »

it doesn't appear to me, I purge the cache, in styles and nothing...what's happening!?
Mandarola
Registered User
Posts: 245
Joined: Tue Sep 25, 2007 3:21 am

Re: [DEV] AJAX Quick Edit

Post by Mandarola »

anybody!?
LDsix
Registered User
Posts: 20
Joined: Fri Sep 01, 2006 2:36 pm

Re: [DEV] AJAX Quick Edit

Post by LDsix »

check URL to the image ;)
Mandarola
Registered User
Posts: 245
Joined: Tue Sep 25, 2007 3:21 am

Re: [DEV] AJAX Quick Edit

Post by Mandarola »

Viewtopic_body.hmtl

Find

Code: Select all

<a href="{postrow.U_EDIT}">
Add Before

Code: Select all

<a href="#" id="quick_edit{postrow.POST_ID}" onclick="quick_edit({postrow.POST_ID}); return false;">{QUICKEDIT_IMG}</a>
the code is this. where and what can I modificated more?
LDsix
Registered User
Posts: 20
Joined: Fri Sep 01, 2006 2:36 pm

Re: [DEV] AJAX Quick Edit

Post by LDsix »

check name of this: img_icon_post_quickedit = icon_post_quickedit.gif in imageset.cfg. make sure it is the same as the .gif file.
or replace {QUICKEDIT_IMG} with normal url to the image (styles/skinname...).
greenkey
Registered User
Posts: 44
Joined: Fri Jan 25, 2008 7:46 pm

Re: [DEV] AJAX Quick Edit

Post by greenkey »

hi!
Guys, i made some changes in this mod, for prosilver template.
Now, its working, but i have one problem - transfer content from post to edit form.
So, when i press "quickedit" i have a empty form...
i not really understand, how it work.
If somebody help me, i can make addon for prosilver...
problem, maybe here (quickedit.html):

Code: Select all

function quick_edit(post_id)
{
	divname = 'postdiv' + post_id;
	get_text(post_id);
	contents = document.getElementById('quick_edit' + post_id).style.display = 'none';
}

function get_text(post_id, contents)
{
	if (contents)
	{
		contents = '&contents=' + contents + '&submit=true';
	}
	else
	{
		contents = '';
	}
	param = 'post_id=' + post_id + contents;	
	http_request.open("POST", '{U_QUICKEDIT}', true);
	http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  	http_request.onreadystatechange = handle_text;
  	http_request.send(param);
}
in template i removed "id" in another tag:
<div class="content" id="postdiv{postrow.POST_ID}">{postrow.MESSAGE}</div>

so, i can make function to take content from this object, but as i think, it is wrong way...
greenkey
Registered User
Posts: 44
Joined: Fri Jan 25, 2008 7:46 pm

Re: [DEV] AJAX Quick Edit

Post by greenkey »

something strange in quickedit.php:

Code: Select all

$sql = 'SELECT p.*, f.*, t.* FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE p.post_id = $post_id AND p.topic_id = t.topic_id AND p.forum_id = f.forum_id";
i am not sure that construction is right...
greenkey
Registered User
Posts: 44
Joined: Fri Jan 25, 2008 7:46 pm

Re: [DEV] AJAX Quick Edit

Post by greenkey »

Shit!!!
This post had forum_id = 0 :shock:
So, no errors in code, but strange bug in db record of post.
greenkey
Registered User
Posts: 44
Joined: Fri Jan 25, 2008 7:46 pm

Re: [DEV] AJAX Quick Edit

Post by greenkey »

cool ;-)
now all works fine in prosilver.
http://forum.greenkey.ru/dload.php?acti ... file_id=48
V@cuum
Registered User
Posts: 1
Joined: Fri Mar 19, 2004 6:45 pm
Location: Russia, Kaluga
Contact:

Re: [DEV] AJAX Quick Edit

Post by V@cuum »

If you want to edit several posts simultaneously you should add «divname = 'postdiv' + post_id;» to next 2 functions after quick_edit(post_id). Also form name need to be changed from quickedit to quickedit{POST_ID} and textarea to textarea{POST_ID}.

And do not forget about template. :) see below

Code: Select all

function quick_edit(post_id)
{
	divname = 'postdiv' + post_id;
	get_text(post_id);
	contents = document.getElementById('quick_edit' + post_id).style.display = 'none';
}

function submit_changes(post_id)
{
	divname = 'postdiv' + post_id;
	contents = document.forms['quickedit' + post_id].elements['textarea' + post_id].value;
	get_text(post_id, contents);
	contents = document.getElementById('quick_edit' + post_id).style.display = '';
}

function cancel_changes(post_id)
{
	divname = 'postdiv' + post_id;
	contents = 'cancel';
	get_text(post_id, contents);
	contents = document.getElementById('quick_edit' + post_id).style.display = '';
}
in quickedit.html (lines 2-3)

Code: Select all

<form method="post" name="quickedit{POST_ID}" id="quickedit{POST_ID}">
<textarea id="textarea{POST_ID}" style="width:95%;" rows="5">{POST_TEXT}</textarea><br />
vdf_belial
Registered User
Posts: 10
Joined: Sat Jan 20, 2007 5:10 pm

Re: [DEV] AJAX Quick Edit

Post by vdf_belial »

So... can anyone try to make a prosilver release for this mod ?
Jonnsn
Registered User
Posts: 34
Joined: Mon Jun 25, 2007 7:59 am

Re: [DEV] AJAX Quick Edit

Post by Jonnsn »

i use the current version with prosilver and it works fine :D
vdf_belial
Registered User
Posts: 10
Joined: Sat Jan 20, 2007 5:10 pm

Re: [DEV] AJAX Quick Edit

Post by vdf_belial »

Jonnsn wrote:i use the current version with prosilver and it works fine :D
Can you tell us how to implement this mod into prosilver ?
Locked

Return to “[3.0.x] Abandoned MODs”