Posts: 20
Threads: 3
Joined: Mar 2015
Nah, str_replace dont work. Testet it with a new comment, in the DB is still the URL with the language-identifier...
Posts: 2,894
Threads: 59
Joined: Jun 2010
Have
you completed
the interview?
Posts: 20
Threads: 3
Joined: Mar 2015
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?