Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> GT - Next Gen and Standard
Author Message
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1159
Location: Sanbornton, NH USA

PostPosted: Thu Jan 20, 2005 2:52 pm Reply with quote

Hi

I've got most of my site GT enabled, but I ran into 1 stupid stickler.

How do you GT encode this?

$url = sprintf("modules.php?name=Surveys&op=results&pollID=%d", $pollID);

The %d (for increasing the count by using the sprintf function) and comma is screwing me all up.

(See blocks-Survey.php)

Thanks
Steph

_________________
Steph Benoit Only registered users can see links on this board! Get registered or login!
1CMS, 100% Section 508 and W3C XHTML/CSS Compliant (Truly) 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Thu Jan 20, 2005 7:37 pm Reply with quote

Do you need both the header and .htaccess code?
 
View user's profile Send private message
64bitguy
PostPosted: Thu Jan 20, 2005 8:08 pm Reply with quote

Well, my thought is if I had either, I could figure out the other.

I tried:
In:
"'(?<!/)modules.php\?name=Surveys&amp;op=results&amp;pollID=([0-9]*)'",

Out:
"survey-results-\\1.html",

htaccess:
RewriteRule ^survey-results-([0-9]*).html modules.php?name=Surveys&op=results&pollID=$1 [L]

To no avail.

It looks like this is how the output properties are, but I'm assuming the sprintf string and %d, are messing up the works.

Any help would be appreciated.

Thanks
 
64bitguy
PostPosted: Mon Jan 24, 2005 10:56 pm Reply with quote

Okay, 1 more once you figure out that one:

I got my Calendar module GT'd including the Print friendly function; however, one thing that I noticed is that this section is not GT'd inside (meaning links in the popup window don't retain GT properties from the module.)

I suspect that as this function is operating by not loading the entire page, it doesn't have the GT associations as it is not actually running in the module.

How would I go about enabling GT links inside the popup, short of having to rewrite (hardcode) all of the variables, which could really be a task to accomplish as it uses dynamic "input" methods in the code itself.

You can see what I mean by visiting Only registered users can see links on this board! Get registered or login!

Thanks
Steph
 
dean
Worker
Worker


Joined: Apr 14, 2004
Posts: 193

PostPosted: Tue Jan 25, 2005 11:13 am Reply with quote

After the demise of Event Calendar, I've been looking for an alternative that has been tapped with GT NextGen. Appears you got it........would you be so kind as to post your GT.php and .htaccess entries so far?
 
View user's profile Send private message
64bitguy
PostPosted: Sat Jan 29, 2005 3:46 pm Reply with quote

Dean...

See: Only registered users can see links on this board! Get registered or login!

Raven & anyone else....

Any ideas about my sprintf survey block problem?

Thanks
Steph
 
Raven
PostPosted: Wed Apr 27, 2005 1:20 pm Reply with quote

64bitguy wrote:
Any ideas about my sprintf survey block problem?

Thanks
Steph


The %d simply makes the value an integer w/o rounding (4.8 becomes 4 - 'union' becomes 0). So, just rewrite the code from
Code:
$url = sprintf("modules.php?name=Surveys&amp;op=results&amp;pollID=%d", $pollID);

to
Code:
$url = "modules.php?name=Surveys&amp;op=results&amp;pollID=".(int) $pollID;

Or you could do this
Code:
<?

$pollID = (int) $pollID;
$url = "modules.php?name=Surveys&amp;op=results&amp;pollID=$pollID;
?>


Here is a little script to show POC
Code:
<?

echo "<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\">";
$pollID = 'union';
echo '<tr><td>$pollID before conversion to Integer</td><td>'.$pollID.'</td></tr>';
$pollID = (int) $pollID;
echo '<tr><td>$pollID after conversion to Integer</td><td>'.$pollID.'</td></tr>';
echo '<tr><td>$url value using sprintf</td><td>'.sprintf("modules.php?name=Surveys&amp;op=results&amp;pollID=%d", $pollID).'</td></tr>';
echo '<tr><td>$url value using converted code</td><td>'."modules.php?name=Surveys&amp;op=results&amp;pollID=$pollID</td></tr>";
echo "</table>";
?>
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> GT - Next Gen and Standard

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©