Author |
Message |
64bitguy
The Mouse Is Extension Of Arm

Joined: Mar 06, 2004
Posts: 1164
|
Posted:
Thu Jan 20, 2005 2:52 pm |
|
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
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Jan 20, 2005 7:37 pm |
|
Do you need both the header and .htaccess code? |
|
|
|
 |
64bitguy

|
Posted:
Thu Jan 20, 2005 8:08 pm |
|
Well, my thought is if I had either, I could figure out the other.
I tried:
In:
"'(?<!/)modules.php\?name=Surveys&op=results&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

|
Posted:
Mon Jan 24, 2005 10:56 pm |
|
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 http://64bit.us/calendar.html
Thanks
Steph |
|
|
|
 |
dean
Worker


Joined: Apr 14, 2004
Posts: 193
|
Posted:
Tue Jan 25, 2005 11:13 am |
|
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? |
|
|
|
 |
64bitguy

|
Posted:
Sat Jan 29, 2005 3:46 pm |
|
|
|
 |
Raven

|
Posted:
Wed Apr 27, 2005 1:20 pm |
|
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 fromCode:$url = sprintf("modules.php?name=Surveys&op=results&pollID=%d", $pollID);
|
toCode:$url = "modules.php?name=Surveys&op=results&pollID=".(int) $pollID;
|
Or you could do thisCode:<?
$pollID = (int) $pollID;
$url = "modules.php?name=Surveys&op=results&pollID=$pollID;
?>
|
Here is a little script to show POCCode:<?
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&op=results&pollID=%d", $pollID).'</td></tr>';
echo '<tr><td>$url value using converted code</td><td>'."modules.php?name=Surveys&op=results&pollID=$pollID</td></tr>";
echo "</table>";
?>
|
|
|
|
|
 |
|