Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 3rd, 2006, 07:41 AM
pepsymax pepsymax is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 1 pepsymax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 54 sec
Reputation Power: 0
Unhappy Help with a comment script!

First i'll apologise as I know little about php, so bear with me if my explanation is not so good!

I've installed a php comment script (a script that allows my users to post a review on my php pages). I've installed it and it works.

However a little error occurs if I want the results to show up on more than one page. The problem is, the code is looking for a url ending with (.php). It then adds the code to forward to the next page directly after the php comment. My pages dont work as they end like this
Code:
index.php?&task=detail&id=7&mode=0&catid=45&navstart=0&search=*


The php comment in the code occurs too early on my pages, so the command to foward appears directly after php and forwards to the wrong page.

So! Instead of producing something like this...

Code:
index.php?&task=detail&id=7&mode=0&catid=45&navstart=0&search=*NEW_PAGE_CODE


It does this

Code:
index.php?NEW_PAGE_CODE


So I think the code tries to open the next page from (index.php) instead of from the end of the code (search*)

Now What I need is to rewrite the script so that it links after the (search=* ) comment.

Ok I think I've explained it... here is the code I have to change. Any ideas?

Code:
<?php

# configuration 
	$emptyMsg 	= " Be the first to add comment to this page.";
	$size 			= 40;	# size of input boxes 
	$cols 			= 53; # width of text areas 
	$rows				= 5;	# height of text areas 

	$bgColor 		= "#eaeaea";

# input box length adjustment code 
	$ie = stristr($HTTP_USER_AGENT, "MSIE") && true;
	$op = stristr($HTTP_USER_AGENT, "Opera") && true;
	$n6 = stristr($HTTP_USER_AGENT, "Netscape6") && true;
	$ns = (!($ie)) && (!($n6));
	$size = fw($size);
	$cols = fc($cols);

function fw($w) {
  global $ns;
  if ($ns == 1) { $w = $w * 0.8; }
  return ceil($w);
}

function fc($w) {
  global $n6;
  if ($n6 == 1) { $w = $w * 0.7; } else { $w = $w * 0.75; }
  return ceil($w);
}

# FUNCTIONS ###################################################################

# Calculate page navigation tool and define the lower and upper record numbers
	function genNav ($listID, $items, $ipp, &$lowLimit, &$topLimit) {
	  $self = $_SERVER['PHP_SELF'];
		if (!isset($_GET['pID'])) { $pID = 0; } else { $pID = $_GET['pID']; }

		$str = "";
		$numberOfPages = ceil($items / $ipp);
		$lowLimit = $pID * $ipp;
		$topLimit = $lowLimit + $ipp;
		if ($topLimit > $items) { $topLimit = $items; }

		for ( $i=0; $i < $numberOfPages; $i++ ) {
			if ($i == $pID) {
				$str .= "<b>".($i+1)."</b> ";
			} else { $str .= "<a href=\"$self?pID=$i&listID=$listID#comment\">".($i+1)."</a> "; }
		}
		return $str;
	}
?>


If you need it the whole script can be found http://www.greatnexus.com/_downloads/commenter.php

Thanks

pep

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Help with a comment script!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway