Hi,
I noticed that there are a lot of comment forms (or reply forms) on the storypage. It's because we have each new form for each "reply" link. I think, it's not good for slow-connected users. First solution is to delete reply form and a link (better for me, eh :) ), another solution is to use javascript/AJAX (copy already existing form in another container), or simply use an hidden input for mainform and copy there parent id when the user hit reply link.
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| A lot of comment forms |
| |||
|
Forget troubleshooting Spice, I think we should gzip files with the following simple php method and they should load like a rocket! All you have to do is put the following line at the VERY top of each PHP document, and just like magic, the entire HTML of the page will be compressed! Code: <? ob_start("ob_gzhandler"); ?>
|
| ||||
|
Daniel, this has already been implemented in Pligg. It didn't have that much of an effect but after using a program called 7-zip i was able to compress all the files manually and then add them to Pligg. This is where a lot of the savings came from.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
| |||
| Quote:
Code: <? ob_start("ob_gzhandler"); ?>
Now, you said you gzipped only .js files and achieved remarkable results, right? Have you gzipped anything else? Could it be that simple? I might gzipped them tonight and then run a clean install. |
| ||||
|
there are 2 files in the SVN called begin_gzip.php and end_gzip.php. You have to enable them via the code at the top of .htaccess. I showed how to use 7-zip in the other performance thread.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
| ||||
|
spice is right, just isolating one comment reply the size is 2.59kb. If you have 10 comments then the size is 25.9kb gzip will help compress it, but compressing an already smaller code is even better heh :)
__________________ Anatomy of the Pligg template Help needed |
| |||
|
Aha! I think, I solve this problem, but need some time for clean up and test. What I have now: one form both for comment and reply at the bottom, when user hit reply link he jumps to the form, both comment and reply works perfect, edit link works too. But may be there is something I've lost... By the way, I have had to modificate some code in comment.php, not big. |
| ||||
| SPICE, we'd like to check it out if you would post it.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
| |||
| Quote:
Code: if(strlen($_POST['comment_content']) > 0){
$comment->content=$_POST['comment_content'];
$cancontinue = true;
// this is a normal new comment
}
if(strlen($_POST['reply_comment_content-'.$_POST['comment_parent_id']]) > 0){
$comment->content = $_POST['reply_comment_content-'.$_POST['comment_parent_id']];
$comment->parent=$_POST['comment_parent_id'];
$cancontinue = true;
// this is a reply to an existing comment
}
Code: if(($_POST['parent_id'])==''){
$comment->content=$_POST['comment_content'];
$cancontinue = true;
// this is a normal new comment
}
if(($_POST['parent_id']) != ''){
$comment->content = $_POST['comment_content'];
$comment->parent=$_POST['parent_id'];
$cancontinue = true;
// this is a reply to an existing comment
}
replace Code: <a href = "javascript://" onClick="var replydisplay=document.getElementById('reply-{$comment_id}').style.display ? '' : 'none'; document.getElementById('reply-{$comment_id}').style.display = replydisplay;">Reply</a>
Code: <a href = "#comment" onClick="document.getElementById('justcomment').style.visibility = 'visible'; document.getElementById('label').innerText = 'Reply for {$user_username}'; document.getElementById('parent_id').innerText = '{$comment_id}';">Reply</a>
and finaly add some code to comment_form.tpl Code: <fieldset><legend>{#PLIGG_Visual_Comment_Send#}</legend>
Code: <fieldset><legend id="label" name="comment">{#PLIGG_Visual_Comment_Send#}</legend>
Code: <input type="hidden" name="parent_id" id="parent_id" value=""> Code: <input type="hidden" name="user_id" value="{$user_id}" />
Code: <div id="reply-{$comment_id}" style="display:none;">
Code: </fieldset> </form> </div> </div> |
| ||||
|
I went ahead and tested this code. It seems to get rid of threaded comments though. So you're either looking for speed without threaded comments or threaded comments.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Show all stories without a comment? | dogmog | Modification Tutorials | 0 | 03-13-2008 05:01 AM |
| Show all stories without a comment | dogmog | General Help | 0 | 03-12-2008 01:28 PM |
| Editing a reply to a comment? | bbrian017 | General Help | 0 | 01-10-2008 04:30 PM |
| A proposal for a more robust way of comment deletion. | sefs | Bug Report | 0 | 10-12-2007 04:30 PM |
| Comment Count Update | Simon | Bug Report | 4 | 06-01-2007 09:45 PM |





Linear Mode

