This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Problem with Pages, cant go to Page 2..
#1

Hi,

Commentics works fine. Can comment, vote, admin. All finde. But when i want to go on a second page the script still stays at page 1. I use a own ID (from an mySQL-DB) to identify my comments.

So i used this:

PHP Code:
<?php 
$cmtx_identifier
= $row['id'];
$cmtx_reference = $row['name'];
...

When i click on the link to the socond page this shows up:

http://www.domain.de/perma/link/site?cmt...x_comments

I think this could be the problem. Anybody can help me here?

kind regards

finzer
Reply
#2

Dont know why i cant edit but i forgot the "normal" comment-link:

http://www.domain.de/perma/link/site

page 2:

http://www.domain.de/perma/link/site?cmt...x_comments

and so on.

When i echo my ID, its the same on every comment-page. So that cant be the problem?
Reply
#3

Still cant edit.

Looked little bit deeper in the code. Found the cmtx_paginate() funktion which refers to $current_page and $cmtx_current_page. $cmtx_current_page uses $_GET['cmtx_page']. may this course the failure?
Reply
#4

Hi finzer,

The URL http://www.domain.de/perma/link/site?cmt...x_comments looks fine to me. So something on your website, maybe some type of re-write rule in your root's .htaccess file, seems to be affecting the $_GET parameters. As I'm not familiar with your site that's the best that I can help.

Have you completed the interview?
Reply
#5

The forum is configured to disallow editing after 15 minutes of posting, so it's not a bug.

Have you completed the interview?
Reply
#6

Hey Steven, thx for the hint. I think i solved the problem. You are correct, it was a problem with my RewriteRules. I use this rule to rewrite my sites:

Quote:RewriteRule ^(.*)/(.*)/site$ /seiten/infos/details.php?foo=$1&bar=$2 [L]

The problem was the L parameter. I tried it with QSA and it seems to work.

I get, after ich go to a second-comments-site, a link like this:

http://www.domain.de/seiten/infos/detail...x_comments

Not very nice, but it works.

Now i have another problem. i rewrite my URLs as you can see. Now i have different languages. EN, ES, NL ... I use the following RewriteRules:

Quote:RewriteRule ^(.*)/(.*)/nl$ /seiten/infos/details_nl.php?foo=$1&bar=$2 [QSA,L]
RewriteRule ^(.*)/(.*)/dk$ /seiten/infos/details_dk.php?foo=$1&bar=$2 [QSA,L]
RewriteRule ^(.*)/(.*)/cz$ /seiten/infos/details_cz.php?foo=$1&bar=$2 [QSA,L]
RewriteRule ^(.*)/(.*)/es$ /seiten/infos/details_es.php?foo=$1&bar=$2 [QSA,L]
RewriteRule ^(.*)/(.*)/$ /seiten/infos/details.php?foo=$1&bar=$2 [QSA]

When somebody comment one of the site, the URL will be written in the DB. Everything is fine. But when he is on another language, for example NL, its a different URL für Commentics, but not for me. Is there a posibillity to change the URLs? I need für every Comment per Site the same URL. No sub-language. Maybe the $cmtx_url can do the trick?

Sorry für my bad english Wink

best regards

finzer
Reply
#7

Ok i think that works:

PHP Code:
<?php 
$search  
= array('en', 'pl', 'nl', 'dk', 'cz', 'es', 'fr', 'it');
$replace = array('', '', '', '', '', '', '', '',);
$cmtx_url = str_replace($search, $replace, $cmtx_url);

Now i have a mobile version too. All on an subdomain like m.domain.de/foo/bar/

Someone got a idea how i rewrite these URLs?
Reply
#8

Nah, str_replace dont work. Testet it with a new comment, in the DB is still the URL with the language-identifier...
Reply
#9

Would any of the dynamic keywords below help?

http://www.commentics.org/wiki/doku.php?...many_pages

Have you completed the interview?
Reply
#10

I thought the $cmtx_url is already a part of these so called dynamic keywords. The only problem ist that it seems i cant overwrite the $cmtx_url which is used for the INSERT statement (which transfers the URL in the DB.pages.url row). Do you know why?  When i use this code

PHP Code:
<?php 
$search  
= array('/en', '/pl', '/nl', '/dk', '/cz', '/es', '/fr', '/it');
$replace = array('/', '/', '/', '/', '/', '/', '/', '/');
$cmtx_url = str_replace($search, $replace, $cmtx_url);

and ich got for exaple a url like this:

http://www.domain.de/foo/bar/en

and ich echo the $cmtx_url nothing changes. Why ist that? I have to overwrite the $cmtx_url. Thats the only way i think. I dont understand why i cant overwrite the $cmtx_url with my new cleaned version. Any suggestions?

Thx a lot so far!

Edit: Ok when i overwrite the variable AFTER the commentics.php include it works:


PHP Code:
<?php 
$cmtx_identifier
= $zeile['id'];
$cmtx_reference = $zeile['name'];
$cmtx_path = $_SERVER['DOCUMENT_ROOT'].'sites/comments/';
require
$cmtx_path.'includes/commentics.php'; //don't edit this line

// Rewrite County-URL
$search  = array('/en', '/pl', '/nl', '/dk', '/cz', '/es', '/fr', '/it');
$replace = array('/', '/', '/', '/', '/', '/', '/', '/');
$cmtx_url = str_replace($search, $replace, $cmtx_url);
echo
'<p>New $cmtx_url: <b>'.$cmtx_url.'</b></p>';

So, where do i have to put in my strg_replace that i can use it proper?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by drwx
29-Jun-2023, 09:34 AM
Last Post by Steven
04-Jul-2020, 06:46 PM
Last Post by MattyP
13-Apr-2020, 08:33 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)