Jump to content
DevFuse Forums

[RESOLVED] FURL


Largo

Recommended Posts

Hello,

 

I've created app and I want to change all of URL's to SEO friendly. That's my furlTemplates.php:

 

<?php
/**
* DiabloTrade.pl
* Forum Gold 2.0.0
* Sets up SEO templates
* 
* @author 		Largo-W
* @copyright   (c) 2008 - 2009 DiabloTrade.pl
* @package 	Forum Gold
* @version 	2.0.0prealpha1
*
*/
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(

'app=fg'        => array(  'app'		    => 'fg',
						   'allowRedirect'  => 1,
						   'out'            => array( '#app=fg$#i', 'fg/' ),
						   'in'             => array( 'regex'   => "#/fg/?$#i",
											          'matches' => array( array( 'app', 'fg' ) ) ) ),

'richest'       => array(  'app'		    => 'fg',
						   'allowRedirect'  => 1,
						   'out'            => array( '#app=fg(?:&|&)module=logs(?:&|$)section=richest$#i', 'fg/richest/' ),
						   'in'             => array( 'regex'   => "#/fg/richest/?$#i",
											          'matches' => array( array( 'app', 'fg' ),
																		 array( 'module', 'logs' ),
																		 array( 'section', 'richest' ) ) ) ),
'security'		=> array(  'app'			=> 'fg',
						   'allowRedirect'	=> 1,
						   'out'			=> array( '#app=fg(?:&|&)module=logs(?:&|$)section=security$#i', 'fg/security/' ),
						   'in'             => array( 'regex'   => "#/fg/security/?$#i",
											          'matches' => array( array( 'app', 'fg' ),
																		 array( 'module', 'logs' ),
																		 array( 'section', 'security' ) ) ) ),
);

 

And i template I used it like:

 

<a href='{parse url="app=fg&module=logs&section=security" template="security" base="public"}' title='' alt=''></a>

 

Why URL didn't changed? I rebuild after file change cache :-)

 

Best regards,

Largo

Link to comment
Share on other sites

coreVariable.php

 

Should have this

if ( $_REQUEST['showsecurity'] )
{
$_RESET['app']     = 'fg';
$_RESET['module']  = 'logs';
$_RESET['section'] = 'security';
}

 

furlTemplate.php


'showsecurity' => array(
	'app'			=> 'fg',
	'allowRedirect'	=> 1,
	'out'			=> array( '#app=fg&showsecurity#i', 'fg/security' ),
	'in'			=> array( 
		'regex'			=> "#/fg/security#i",
		'matches'		=> array( 
			array( 'app'		, 'fg' ),
			array( 'module'		, 'logs' ),
			array( 'section'	, 'security' )
		)
	)	
),

 

Then Template

<a href='{parse url="showsecurity" seotitle="security" template="showsecurity" base="publicWithApp"}'>Security</a>

 

Final link will be

 

http://ursite.com/fg/security

Link to comment
Share on other sites

coreVariable.php

 

Should have this

if ( $_REQUEST['showsecurity'] )
{
$_RESET['app']     = 'fg';
$_RESET['module']  = 'logs';
$_RESET['section'] = 'security';
}

 

furlTemplate.php


'showsecurity' => array(
	'app'			=> 'fg',
	'allowRedirect'	=> 1,
	'out'			=> array( '#app=fg&showsecurity#i', 'fg/security' ),
	'in'			=> array( 
		'regex'			=> "#/fg/security#i",
		'matches'		=> array( 
			array( 'app'		, 'fg' ),
			array( 'module'		, 'logs' ),
			array( 'section'	, 'security' )
		)
	)	
),

 

Then Template

<a href='{parse url="showsecurity" seotitle="security" template="showsecurity" base="publicWithApp"}'>Security</a>

 

Final link will be

 

http://ursite.com/fg/security

 

Hello,

 

Thanks Sacred! You have right, I do it now, but in official documentation there is no information about that. I used it for my apps.

 

Best regards,

Largo

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...