Go Back   Pligg CMS Forum > Pligg Help > General Help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-07-2007, 08:23 PM
New Pligger
 
Join Date: Jan 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
A lot of comment forms

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.
Reply With Quote
  #2 (permalink)  
Old 02-08-2007, 12:22 AM
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Thanks: 6
Thanked 0 Times in 0 Posts
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"); ?>
Read more here http://www.pligg.com/forum/showpost....1&postcount=20
Reply With Quote
  #3 (permalink)  
Old 02-08-2007, 12:28 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
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.
Reply With Quote
  #4 (permalink)  
Old 02-08-2007, 12:34 AM
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kbeeveer46 View Post
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.
It doesn't seem to be implemented. I just randomly checked this file admin_index.php. This line of code was not added:

Code:
<? ob_start("ob_gzhandler"); ?>
According to the link you provided earlier, that line of the code should be added to all php files.

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.
Reply With Quote
  #5 (permalink)  
Old 02-08-2007, 12:37 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
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.
Reply With Quote
  #6 (permalink)  
Old 02-08-2007, 04:24 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,218
Thanks: 64
Thanked 207 Times in 148 Posts
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
Reply With Quote
  #7 (permalink)  
Old 02-08-2007, 08:36 AM
New Pligger
 
Join Date: Jan 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #8 (permalink)  
Old 02-08-2007, 08:41 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
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.
Reply With Quote
  #9 (permalink)  
Old 02-08-2007, 11:00 AM
New Pligger
 
Join Date: Jan 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
we'd like to check it out if you would post it.
I've replace this
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
		}
to this
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
		}
in story.php

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>
to
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>
in comment_show.tpl

and finaly add some code to comment_form.tpl

Code:
<fieldset><legend>{#PLIGG_Visual_Comment_Send#}</legend>
replace with
Code:
<fieldset><legend id="label" name="comment">{#PLIGG_Visual_Comment_Send#}</legend>
and
Code:
<input type="hidden" name="parent_id" id="parent_id" value="">
after
Code:
<input type="hidden" name="user_id" value="{$user_id}" />
Of cause, delete hidden layer in comment_show.tpl from
Code:
<div id="reply-{$comment_id}" style="display:none;">
to
Code:
  					</fieldset>
  				</form>
  			</div>
  		</div>
Hopes I wrote all clearly, 'cause do a lot of template changes before :))). Backup files before!
Reply With Quote
  #10 (permalink)  
Old 02-08-2007, 11:30 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
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.
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
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


Search Engine Friendly URLs by vBSEO 3.2.0