Skocz do zawartości

Rekomendowane odpowiedzi

Opublikowano

Mam problem z linkiem w menu głównym:

<li id='nav_custom_link' class='left'><a href='index.php?app=core&module=global&section=page'>Link</a></li>

Jeżeli jestem na stronie głównej, to działa poprawnie, jednak jeżeli wejdę w topic i użyję linku, to mam "stary link"+index.php?app=core&module=global&section=page

Chciałbym to jeszcze połączyć z przyjaznym linkiem.

Spróbowałem reguły

RewriteRule ^link$ index.php?app=core&module=global&section=page

I dodałem do mojego .htaccess

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^link$ index.php?app=core&module=global&section=page
</IfModule>

Lecz bez efektu. Wrzucając podaną regułę przed RewriteRule . /index.php [L] w ogóle się sypie.

W tym to jestem zielony :]

Opublikowano (edytowane)

Dzięki, działa.

Tylko było trzeba usunąć "?" z tego kodu.

A jak przerobić to na przyjazny link? Tak by nie kolidowało z tym co już mam?

Edytowane przez melior
  • Manager
Opublikowano

Nie nie, generować nie będzie. Cóż, trzeba by dodać nową regułę do pliku FURLa.. Z tym, że teraz nie bardzo chce mi się to robić, a raczej nie mam czasu. Odezwij się wieczorkiem.

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

  • Manager
Opublikowano

Link będzie taki:

<a href="{parse url="app=core&module=global&section=page" template="custom_link_tpl" base="public"}">

Potem np. w pliku: admin/applications/forums/extensions/furlTemplates.php

Wstawiasz przed:

);

taki oto kod:

'custom_link_tpl'  => array( 
					'app'			=> 'core',
					'allowRedirect' => 0,
					'out'			=> array( '#app=core((&|&)module=global((&|&)section=page)?#i', 'custom_page/' ),
					'in'			=> array( 
												'regex'		=> "#/custom_page(/|$|\?)#i",
												'matches'	=> array( array( 'app', 'core' ),
																	  array( 'module', 'global' ),
																	  array( 'section', 'page' )  )
											) 
								),	

Nie zapomnij na końcu odświeżyć cache FURL - pojawi się monit, jak wejdziesz do ACP, że FURL-e wymagają aktualizacji.

Hahah, ciekawe czy się walnąłem, pisane z palca! :thumbsup:

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Opublikowano (edytowane)

Dodałem, przebudowałem.

W custom_page zostałem uraczony takimi komunikatami

 Warning: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 55 in /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/base/ipsRegistry.php on line 1542  
Warning: Cannot modify header information - headers already sent by (output started at /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/base/ipsRegistry.php:1542) in /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/classes/output/formats/html/htmlOutput.php on line 109 
Warning: Cannot modify header information - headers already sent by (output started at /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/base/ipsRegistry.php:1542) in /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/classes/output/formats/html/htmlOutput.php on line 120
Warning: Cannot modify header information - headers already sent by (output started at /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/base/ipsRegistry.php:1542) in /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/classes/output/formats/html/htmlOutput.php on line 129
Warning: Cannot modify header information - headers already sent by (output started at /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/base/ipsRegistry.php:1542) in /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/classes/output/formats/html/htmlOutput.php on line 130
Warning: Cannot modify header information - headers already sent by (output started at /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/base/ipsRegistry.php:1542) in /home/strefarp/domains/strefarpg.o12.pl/public_html/admin/sources/classes/output/formats/html/htmlOutput.php on line 134

Edytowane przez melior
Opublikowano
<?php

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
$_SEOTEMPLATES = array(

'showannouncement'     => array( 'app'		     => 'forums',
								 'allowRedirect' => 1,
								 'out'           => array( '#showannouncement=(.+?)((?:&|&)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1-#{__title__}/$4' ),
						  		 'in'            => array( 'regex'   => "#/forum-(\d+?)?/announcement-(\d+?)-#i",
												 		   'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),

'showforum'     => array( 'app'		      => 'forums',
						  'allowRedirect' => 1,
						  'out'           => array( '#showforum=(.+?)(&|$)#i', 'forum/$1-#{__title__}/$2' ),
						  'in'            => array( 'regex'   => "#/forum/(\d+?)-#i",
												    'matches' => array( array( 'showforum', '$1' ) ) ) ),

'showtopic'     => array( 'app'		      => 'forums',
						  'allowRedirect' => 1,
						  'out'           => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
						  'in'            => array( 'regex'   => "#/topic/(\d+?)-#i",
											        'matches' => array( array( 'showtopic', '$1' ) ) ) ),

'act=idx'       => array( 'app'		      => 'forums',
						  'allowRedirect' => 0,
						  'out'           => array( '#act=idx(&|$)#i', 'index$1' ),
						  'in'            => array( 'regex'   => "#/index(/|$|\?)#i",
											        'matches' => array( array( 'act', 'idx' ) ) ) ),
'custom_link_tpl'  => array( 
                                               'app'                   => 'core',
                                               'allowRedirect' => 0,
                                               'out'                   => array( '#app=core((&|&)module=global((&|&)section=page)?#i', 'custom_page/' ),
                                               'in'                    => array( 
                                                                                                       'regex'         => "#/custom_page(/|$|\?)#i",
                                                                                                       'matches'       => array( array( 'app', 'core' ),
                                                                                                                                                 array( 'module', 'global' ),
                                                                                                                                                 array( 'section', 'page' )  ) ) )

);

  • Manager
Opublikowano

@up: na pewno nie..

A tak:

<?php

if ( ! defined( 'IN_IPB' ) )
{
       print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
       exit();
}
$_SEOTEMPLATES = array(

       'showannouncement'     => array( 'app'               => 'forums',
                                                                        'allowRedirect' => 1,
                                                                        'out'           => array( '#showannouncement=(.+?)((?:&|&)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1-#{__title__}/$4' ),
                                                                        'in'            => array( 'regex'   => "#/forum-(\d+?)?/announcement-(\d+?)-#i",
                                                                                                                          'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),

       'showforum'     => array( 'app'               => 'forums',
                                                         'allowRedirect' => 1,
                                                         'out'           => array( '#showforum=(.+?)(&|$)#i', 'forum/$1-#{__title__}/$2' ),
                                                         'in'            => array( 'regex'   => "#/forum/(\d+?)-#i",
                                                                                                           'matches' => array( array( 'showforum', '$1' ) ) ) ),

       'showtopic'     => array( 'app'               => 'forums',
                                                         'allowRedirect' => 1,
                                                         'out'           => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
                                                         'in'            => array( 'regex'   => "#/topic/(\d+?)-#i",
                                                                                                       'matches' => array( array( 'showtopic', '$1' ) ) ) ),

       'act=idx'       => array( 'app'               => 'forums',
                                                         'allowRedirect' => 0,
                                                         'out'           => array( '#act=idx(&|$)#i', 'index$1' ),
                                                         'in'            => array( 'regex'   => "#/index(/|$|\?)#i",
                                                                                                       'matches' => array( array( 'act', 'idx' ) ) ) ),
'custom_link_tpl'  => array( 
                                               'app'                   => 'core',
                                               'allowRedirect' 		=> 0,
                                               'out'                   => array( '#app=core((&|&)module=global((&|&)section=page)?#i', 'custom_page/' ),
                                               'in'                    => array( 
                                                                                                       'regex'         => "#/custom_page(/|$|\?)#i",
                                                                                                       'matches'       => array( 

																															) 
																			) 
						)

);

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.