cotonti.com : Hacking UrlEditor https://www.cotonti.com Последние сообщения в теме Cotonti en Tue, 24 Mar 2026 08:03:38 -0000 Eugene Thank you for advice!

I made this piece of code


if ($path[0] == 'users' && $count == 3 && !isset($_GET['m'])) {

    $_GET['e'] = 'users';
    $_GET['m'] = 'details';
    $_GET['u'] = $path[1];
    $_GET['det'] = $path[2];

    return;
}

and in urltrans.dat

users	m=details&u=*&det=*		users/{cot_url_username()}/{$det}

Thank you ))

 

]]>
пн, 28 янв 2013 14:05:00 -0000
Trustmaster Using urleditor.rewrite.first seems to be a better way if you want to reuse other stuff from that function. There's no need to overwrite most of it, you just need to put there your if and then call return when you're done.

]]>
пн, 28 янв 2013 12:35:39 -0000
Eugene Hello!

Just need to rewrite urls like this... /users/Eugene/blabla ( GETting that as m=details&u=*&det=*)

In urleditor.functions.php I found a line (#85)

if ($path[0] == 'users' && $count == 2 && !isset($_GET['m']))

so, this $count == 2 is limiting me in my task.

What is the best COT-way to hack it?

  • creating function cot_apply_rwr_custom() and place it on the INPUT hook ...      OR
  • use hook urleditor.rewrite.first  to recode major part of  function cot_apply_rwr()

Is there better way?

]]>
пн, 28 янв 2013 11:37:09 -0000