emanuele45 / prettyurls

Automatically exported from code.google.com/p/prettyurls
Other
0 stars 0 forks source link

Javascript rewriting #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
If one topic or board have much more page. And you try to click "..." from
(page_index feature) this url's not pretty.
If you don't understand please look this images.

http://img38.imageshack.us/img38/3817/adszctq.png
http://img32.imageshack.us/img32/3289/adsz2xyl.png

And also try in
http://www.rockayseri.net/rk/turk-rock-ve-metal/?language=english

This is a bug or problem? I don't think actually, i want to report it.

Original issue reported on code.google.com by vazgec on 19 Jun 2009 at 8:18

GoogleCodeExporter commented 8 years ago
There were too many problems with JS that I had to make it just ignore JS 
completely.
But... perhaps I should investigate it again.

In the case of the pages... when you click on them, you'll be redirected to the
pretty version.

Original comment by curiousdannii on 19 Jun 2009 at 4:00

GoogleCodeExporter commented 8 years ago
I really need help on this Danni. 
I want to use this code
var smf_scripturl = "' , !empty($context['current_board']) ? $scripturl . 
'?board=' .
$context['current_board'] . '.0"' : '"'.$scripturl.'"' , '

My example boardurl : 
http://yoneticilerle-paylas.rockayseri.net/rastgele-birkac-film/
And Smf javascripts don't work because cross domain policy. 
So i must change javascript scripturl in index.template. But that code don't 
work.
Showed non-pretty board link in any boards. (var smf_scripturl =
"http://www.rockayseri.net/rk/index.php?board=104.0"; etc..) Can you help on 
this ?

Original comment by vazgec on 30 Jul 2009 at 9:02

GoogleCodeExporter commented 8 years ago
I understand now. PrettyUrls don't replace the board url, if board url not 
linked. 
So i can't use this code
var smf_scripturl = "' , !empty($context['current_board']) ? $scripturl . 
'?board=' .
$context['current_board'] . '.0"' : '"'.$scripturl.'"' , '

I make a new function 
function hangiscript($bolum)
{
global $context;
if ($bolum == 2) { echo 'http://haberler2.rockayseri.net/index.php'; }  
elseif ($bolum == 6)  { echo 
'http://yabanci-rock-ve-metal.rockayseri.net/index.php'; }  
elseif ($bolum == 7)  { echo 'http://amator-gruplar.rockayseri.net/index.php'; 
} 
elseif ($bolum == 12)  { echo 'http://sinema.rockayseri.net/index.php'; }
else { echo 'http://www.rockayseri.net/rk/index.php'; }
}
bla bla bla.. This is very hard actually. I can't get it pretty board url's in 
sql
query. Because all boards on the same value. 
Maybe (in future) you can add new pretty table for boards. This is more useable 
and
more flexible.
And solved my problem for now. 
Thanks for great mod (:

Original comment by vazgec on 30 Jul 2009 at 9:40

GoogleCodeExporter commented 8 years ago
I'm not sure what your problem is, can you explain it again?

Are you trying to get the board names to appear in the subdomains?

Original comment by curiousdannii on 3 Aug 2009 at 2:14

GoogleCodeExporter commented 8 years ago
Dannii,
I edit my boardurl lookup system, so my boards urls worked like a subdomains. 
etc : board1.site.com. Everythings worked fine but.. I need some smf_scripturl
changing in smf script files. Because browser see subdomain and normal domain is
different, so i can't use xhttprequest directly in subdomain. If js try to 
receive
information for normal subdomain, browser don't support this. So smf_scripturl 
should
be set to subdomain url in some area. 
I try to use this
----
',$scripturl,'index.php?board=',$context['current_board'],'.0
----
If this value not linked, pretty don't replace to this url. I think this is 
normally.
Because pretty search <a> or something like that pattern and replace to urls. 
So..
Pretty just showed site.com/index.php?board=55
I need to prettifys link.
So i make a function. (I already write to example to above message)
And use the hangiscript($context['current_board'])

Question is this.
"How can i recevie current board prettify link ?"

Original comment by vazgec on 3 Aug 2009 at 2:44

GoogleCodeExporter commented 8 years ago
Also i explain my works on this topic
http://www.simplemachines.org/community/index.php?topic=328030.0

Original comment by vazgec on 3 Aug 2009 at 2:45

GoogleCodeExporter commented 8 years ago
You can get the board URLs from $context['pretty']['board_urls']

So you probably want $context['pretty']['board_urls'][$context['current_board']]

Original comment by curiousdannii on 3 Aug 2009 at 4:14

GoogleCodeExporter commented 8 years ago
I use http://',$context['pretty']['board_urls'][$context['current_board']]
,'.rockayseri.net for now and worked like a charm. Thanks You're the great man 
Dannii. =)

Original comment by vazgec on 3 Aug 2009 at 5:10