Page 3 of 3

Posted: Fri 2. Feb 2007, 09:31
by dbaron
Hello

I use it, but for images, the "click enlarge" function doesn't work correctly: the image opens in the same window, not in a popup.

Any idea?

Thanks

Posted: Fri 2. Feb 2007, 09:42
by Oliver Georgi
what is your problem?

Oliver

Posted: Fri 2. Feb 2007, 09:51
by dbaron
Oliver Georgi wrote:what is your problem?

Oliver
Hi Oliver
the function "click to enlarge" doens't open the image in a popup, but in the same window.

You can try here

Posted: Fri 2. Feb 2007, 10:25
by Oliver Georgi
what does this have to do with pagination? Check template settings, JavaScript - maybe.

Oliver

Posted: Fri 2. Feb 2007, 10:42
by dbaron
It is not a template or javascript problem, because one page with [PAGINATION] doesn't open images in a popup, and one page without [PAGINATION] works correctly

Page ok here but without pagination
Page not ok here but with pagination

Posted: Fri 2. Feb 2007, 10:55
by fopulu
That's right.
I got the same Problem! But only with the CP Images (Bilder)....

Posted: Fri 2. Feb 2007, 11:19
by Oliver Georgi
there is something wrong!!!

Pagination works for "level article listing" only at the moment. The setting under article summary makes no sense at the moment.

All links you have sent are about in-article pagination - sorry. Not what I have meant.

Oliver

Posted: Fri 2. Feb 2007, 21:00
by jsw_nz
Hi Guys,

Just came across this thread... yes there is an issue - so the javascript needs to be cleaned up. So on line 71-72 use a string replace:

Code: Select all

$cleaned_output = str_replace("\\","",$pageArray[$thisPageNum-1]);
$pageOutput .= "<div>".$cleaned_output."</div>";
This should allow popups.

Cheers,
:D

(also updated original script on page 1)

Posted: Sat 3. Feb 2007, 08:31
by dbaron
Thanks, is works great :D

Posted: Sun 4. Feb 2007, 10:02
by fopulu
thanks jsw_nz! :D

Posted: Thu 12. Apr 2007, 14:16
by Peekay
Peekay wrote:The REQUEST_URI function just doesn't work on my setup.
It appears that $_SERVER["REQUEST_URI"] only works on Apache web server, not IIS. I build using IIS as I also do some sites using ASP.

Thx Oliver for the constant. I'll use that instead. :)

Posted: Tue 24. Apr 2007, 07:33
by ozzimark
nice :D

sometimes forward and backwards buttons are nice. I haven't checked for compatiblity with anything other than my specific setup, but this comes out formatted quite nicely in my opinion.

heads up! - i took out the code that allows compatiblity with non-apache and rewrite logic to save a bit of space :oops:

Code: Select all

<?php
define ("REWRITE_ext", ".phtml");
/* if using rewrite two additional rules need to be placed in .htaccess -
also order is important - /subdirectory example is shown here - same would apply to rules for root
RewriteBase /subdirectory
#new
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)_([0-9]+)\.phtml$ /subdirectory/index.php?id=$1,$2,$3,$4,$5,$6&p=$7
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ /subdirectory/index.php?id=$1,$2,$3,$4,$5,$6
#new
RewriteRule ^(.+)_([0-9]+)\.phtml$ /subdirectory/index.php?$1&p=$2
RewriteRule ^(.+)\.phtml$ /subdirectory/index.php?$1
*/

function show_page($pageInput) {
   global $phpwcms;
   // next line for apache servers
   $this_url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
   // for non-apache servers uncomment next line (a temporary solution - will update)
   // $this_url = FE_CURRENT_URL;
   $appendString = "_";
   $thisPageNum = 1; // default page
   if ($_GET['p']) {
      // page # is specified
      $thisPageNum = $_GET['p'];
   } // end if GET
   if(intval(strpos($this_url,"&p")!=-1)){
      $url_suffix_array = explode("&p", $this_url);
      $this_url = $url_suffix_array[0];
   }
   $pageArray = explode("[PB]", $pageInput); // now parse the content
   $thisPageCount = count($pageArray);
   if(($thisPageNum > $thisPageCount) || ($thisPageNum < 1)) {
      $thisPageNum = 1;
   } // end if thisPageNum
   // format output to show which page we are looking
   // unless looking at page 1 -- display a mini-navbar for the other pages.
   // order can change - this example places navbar at top of output;
   if ($thisPageCount > 1) {
      $pageOutput = "<div>";
	if ($thisPageNum > 1) {
         $Prev = $thisPageNum - 1;
         if( $Prev > 1) {
	      $pageOutput .= "<a href=\"$this_url&p=$Prev\"><<</a> &nbsp;";
         } else {
	      $pageOutput .= "<a href=\"$this_url\"><<</a> &nbsp;";
         }
      }else{
         $pageOutput .= "<< &nbsp;";
      }
      for ($i = 1; $i <= $thisPageCount; $i++) {
         if ($i == $thisPageNum) {
            $pageOutput .= "<b>$i</b>";
         }else{
            if ($i > 1) {
               $pageOutput .= "<a href=\"$this_url&p=$i\">$i</a>";
            }else{
               $pageOutput .= "<a href=\"$this_url\">$i</a>";
            }
         }
         if ($i < $thisPageCount) {
            $pageOutput .= ", &nbsp;";
         }
      }	
	if ($thisPageNum < $thisPageCount) {
         $Next = $thisPageNum + 1;
         if( $Next > 1) {
	      $pageOutput .= "&nbsp;<a href=\"$this_url&p=$Next\">>></a>";
         } else {
	      $pageOutput .= "&nbsp;<a href=\"$this_url\">>></a>";
         }
      }else{
         $pageOutput .= "&nbsp;>>";
      }
    $pageOutput .= "</div>\n";
     // select the proper section of content
     // NEXT LINE ADDED TO ALLOW POPUPS - ADDED 02/2007
     $cleaned_output = str_replace("\\","",$pageArray[$thisPageNum-1]);
     $pageOutput = "<div>".$cleaned_output."</div><br /><br /><center>".$pageOutput."</center>";
   }
   return $pageOutput;
} // end function

// sniff for tag
//UPDATED to strip out preg_replace 'unfriendly' characters

if( ! (strpos($content["all"],'[PAGINATE]')===false)) {
   $content["all"] = preg_replace('/\[PAGINATE\](.*?)\[\/PAGINATE\]/se', 'show_page("$1");', $content["all"]);
   }

// end script
?> 

Posted: Sun 6. May 2007, 02:54
by jsw_nz
Hi ALL,

Just to let everyone know about OliG's superior solution to this feature, found in newest release (133)

VERY FLEXIBLE.....

Just to let everyone know OliG does listen
...and comes up with a better solution!!!

http://www.phpwcms.de/forum/viewtopic.php?t=14664

Thanks for this special feature Oli!!!

cheers from NZ
john
:D