Go Back   Mosets Community > Archives > Mosets Hot Property 1.0 > Discussions, Troubleshooting and Problems

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2008, 12:04 PM
meikeric meikeric is offline
Mosets'd
 
Join Date: Jan 2006
Location: Johnson City, TN.
Posts: 54
Default SOLUTION - SEO HP 1.0beta

Hello all,
HP 1.0beta does not include a router.php to allow for Joomla 1.5 managed SEO so I've gone ahead and built a simple one. As I dig more into HP 1.0b, I'll add updates to this.

So without further ado, here it is...

Instructions: Create a file called "router.php" and place it in your /components/com_hotproperty/ directory. In this file place the below code.

Code:
<?php
/**
* @version	$Id: router.php 6676 2008-07-10 05:52:03Z Meikeric $
* @package	Hotproperty
* @copyright	Copyright (C) 2008 Eferi. All rights reserved.
* @license	GNU/GPL, see LICENSE.php
* This is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/

function HotpropertyBuildRoute(&$query) {
	//print_r($query);

	$segments = array();
	
	if(isset($query['view'])) {
		$segments[] = $query['view'];
		unset($query['view']);
		
		if(isset($query['id']) && $query['id'] > 0) {
			$segments[] = $query['id'];

			unset($query['id']);
		} else {
			unset($query['id']);
		}
	} else {
		$segments[] = '';
	}

	return $segments;
}

function HotpropertyParseRoute($segments) {
	//print_r($segments);

	$vars = array();
	
	//Get the active menu item
	$menu =& JSite::getMenu();
	$item =& $menu->getActive();
	
	// Count route segments
	$count = count($segments);

	$view = $segments[0];

	if($count > 1) {
		$id = $segments[1];
		
		$vars['id'] = $id;
	}

	$vars['view'] = $view;
	
	return $vars;
}

?>
As always, if you need assistance, I'm available for hire, just email me at mike<at>eferi(dot)com.

Thanks!
Mike

Last edited by meikeric; 07-11-2008 at 12:12 PM.
  #2  
Old 07-12-2008, 06:36 PM
jonathanmaliepaard jonathanmaliepaard is offline
Mosets'd
 
Join Date: Jul 2008
Posts: 26
Default

Hi Mike

Just wanted to say thanks - it works a treat!

Cheers

Jon.
  #3  
Old 07-12-2008, 11:10 PM
samarapadilla7394 samarapadilla7394 is offline
Mosets'd
 
Join Date: Jul 2008
Posts: 57
Default

Thanks a bunch for this!!
  #4  
Old 07-13-2008, 04:00 PM
ssnobben ssnobben is offline
Mosets'd
 
Join Date: Nov 2006
Posts: 805
Lightbulb

Hi

if this works fine could this not be implemented in the next release of HP 1.0 Mr Lee?

rgds
  #5  
Old 07-14-2008, 09:51 PM
kasi kasi is offline
Mosets'd
 
Join Date: Sep 2006
Posts: 89
Arrow Works fine for me..

Works fine with Emir Advanced SEF,

thx
Kasimir61
  #6  
Old 08-08-2008, 03:55 PM
suryanto suryanto is offline
Junior Member
 
Join Date: Aug 2008
Posts: 1
Default Itemid

This router.php do not include menu Itemid. I need this to show module position based on menu Itemid.

Is there any solution for this problem?

Regards,
Suryanto
  #7  
Old 08-26-2008, 11:02 PM
Dehaw Dehaw is offline
Mosets'd
 
Join Date: Oct 2005
Location: Scotland
Posts: 357
Default With Itemid

Hi Guys,

Try this edited code:

PHP Code:
<?php
/**
* @version    $Id: router.php 6676 2008-07-10 05:52:03Z Meikeric $
* @package    Hotproperty
* @copyright    Copyright (C) 2008 Eferi. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* This is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/

function HotpropertyBuildRoute(&$query) {
    
//print_r($query);

    
$segments = array();
    
    if(isset(
$query['view'])) {
        
$segments[] = $query['view'];
        unset(
$query['view']);
        
        if(isset(
$query['id']) && $query['id'] > 0) {
            
$segments[] = $query['id'];

            unset(
$query['id']);
        } else {
            unset(
$query['id']);
        }
        
    if(isset(
$query['Itemid'])){
        
$segments[]    = (int) $query['Itemid'];
        unset(
$query['Itemid']);
    }
    
    } else {
        
$segments[] = '';
    }

    return 
$segments;
}

function 
HotpropertyParseRoute($segments) {
    
//print_r($segments);

    
$vars = array();
    
    
//Get the active menu item
    
$menu =& JSite::getMenu();
    
$item =& $menu->getActive();
    
    
// Count route segments
    
$count count($segments);

    
$view $segments[0];

    if(
$count 1) {
        
$id $segments[1];
        
        
$vars['id'] = $id;
    }

    
$vars['view'] = $view;
    
    return 
$vars;
}

?>
__________________
Follow us on Facebook
Following us on Twitter
  #8  
Old 10-14-2008, 07:32 PM
Dehaw Dehaw is offline
Mosets'd
 
Join Date: Oct 2005
Location: Scotland
Posts: 357
Default

Hi Lee,

Is there any chance you can provide a production version of the router.php file for HP?

Thanks

Derek
__________________
Follow us on Facebook
Following us on Twitter
  #9  
Old 10-15-2008, 06:03 PM
dknight dknight is offline
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 26,738
Default

This is one of our tasks by stable release. Stay tuned
__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
  #10  
Old 12-09-2008, 02:13 AM
silvia silvia is offline
Member
 
Join Date: Mar 2005
Posts: 39
Smile

Hi!

this works fine for me, but I would like a little change if somebody expert would be nice to make it up.

My site shows: www.site.com/'id of menu'/property/1.html
and
www.site.com/'id of menu'/agent/1.html


It would be wonderful to swap in the first one "property" for example with the name of the agent and 1 with the tittle of the property

In the secont url , for the agent display, would be nice to substitute agent/1.html with the name of the agent.

Not matter if it's this way, would be nice something to avoid the words property and agent, and avoid to id with numbers.

Some help with be highly appreciate.

Thank you very much
  #11  
Old 01-05-2009, 10:41 AM
rizzomattson rizzomattson is offline
Junior Member
 
Join Date: Jun 2007
Location: Augusta Maine
Posts: 24
Default

thid doesn't work for me...I get to the property listings, but when i click to go to the detail page, I get a 404
  #12  
Old 01-07-2009, 06:05 AM
benjaminnrudolph benjaminnrudolph is offline
Mosets'd
 
Join Date: Jul 2008
Posts: 9
Default Change SEF URL to property name?

Is it possible to change the Joomla SEF URL from:

component/hotproperty/property/1/5

to this

/properties/steamboat/1523-cobblestone-st

I'm just using the built in Joomla 1.5 solution with the router.php file above. I tried sh404sef and it was horrible and SEF Advance I had to manually create each URL, which I know my client will complain about.

thanks in advance.
  #13  
Old 01-15-2009, 07:50 PM
hassanali20 hassanali20 is offline
Junior Member
 
Join Date: Jan 2009
Posts: 3
Default router.php doesn't work for me

the code posted above doesn't work for me. do i need to use the router.php for HP 1.0b along with any SEF extension or just put this file in componente/com_hotproperty folder?

i did the later and its not working, i don't see any change in the while browsing properties.

my sef settings for joomla 1.5.8 is enabled using .htaccess.

please adivce
  #14  
Old 01-21-2009, 09:17 PM
ssnobben ssnobben is offline
Mosets'd
 
Join Date: Nov 2006
Posts: 805
Question Not work for me!

This didnt change anything! still got this since I tried it.. J 1.5.9 and HP 1.0b4

xxx/component/hotproperty/type/10

So no one have a solution for solving this important SEO for Google search of HP etc???

rgds!

Quote:
Originally Posted by Dehaw View Post
Hi Guys,

Try this edited code:

PHP Code:
<?php
/**
* @version    $Id: router.php 6676 2008-07-10 05:52:03Z Meikeric $
* @package    Hotproperty
* @copyright    Copyright (C) 2008 Eferi. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* This is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/

function HotpropertyBuildRoute(&$query) {
    
//print_r($query);

    
$segments = array();
    
    if(isset(
$query['view'])) {
        
$segments[] = $query['view'];
        unset(
$query['view']);
        
        if(isset(
$query['id']) && $query['id'] > 0) {
            
$segments[] = $query['id'];

            unset(
$query['id']);
        } else {
            unset(
$query['id']);
        }
        
    if(isset(
$query['Itemid'])){
        
$segments[]    = (int) $query['Itemid'];
        unset(
$query['Itemid']);
    }
    
    } else {
        
$segments[] = '';
    }

    return 
$segments;
}

function 
HotpropertyParseRoute($segments) {
    
//print_r($segments);

    
$vars = array();
    
    
//Get the active menu item
    
$menu =& JSite::getMenu();
    
$item =& $menu->getActive();
    
    
// Count route segments
    
$count count($segments);

    
$view $segments[0];

    if(
$count 1) {
        
$id $segments[1];
        
        
$vars['id'] = $id;
    }

    
$vars['view'] = $view;
    
    return 
$vars;
}

?>
__________________
Success in the long run Its not about the code its about the people and community that's make it!
  #15  
Old 01-21-2009, 10:17 PM
hassanali20 hassanali20 is offline
Junior Member
 
Join Date: Jan 2009
Posts: 3
Default does it work for you

ssnobben, does it work for you with 1.5.9 or no, could you got that piece of code working posted by dehaw?
  #16  
Old 01-21-2009, 11:43 PM
ssnobben ssnobben is offline
Mosets'd
 
Join Date: Nov 2006
Posts: 805
Default

No it doesnt work and it doesnt work with JoomSef patch_159_stable or either Sh404sef newest version too com_sh404SEF-15_1.0.16_Beta_build_222.

When I tried that latest version Sh404sef with and without this router I got this error and site crashed.

Warning: require(/home/xxxx/public_html/administrator/components/com_hotproperty/config.hotproperty.php) [function.require]: failed to open stream: No such file or directory in /home/xxxxx/public_html/components/com_sh404sef/sef_ext/com_hotproperty.php on line 35

Fatal error: require() [function.require]: Failed opening required '/home/xxxx/public_html/administrator/components/com_hotproperty/config.hotproperty.php' (include_path='.:/usr/lib/php') in /home/xxxx/public_html/components/com_sh404sef/sef_ext/com_hotproperty.php on line 35

Well hope Mr Lee can help with this important SEO for HP.

The com_sh404SEF-15_1.0.16_Beta_build_222 working for Mosets Tree 2.0.9 though but If you have both extension on your site well than it crashes.
__________________
Success in the long run Its not about the code its about the people and community that's make it!
  #17  
Old 02-19-2009, 06:54 PM
sharkufc sharkufc is offline
Junior Member
 
Join Date: Oct 2008
Posts: 5
Default

I've tried your solution but not work when a user logout.
By joomla i've setted on logout the frontpage redirection and with this router.php i receive an error message: header already set by router.php
There is a solution?
  #18  
Old 09-03-2009, 04:54 PM
jamus jamus is offline
Member
 
Join Date: Jun 2009
Posts: 65
Default

Has anyone any solution to SEO in HP 1.0?
  #19  
Old 09-03-2009, 05:10 PM
ssnobben ssnobben is offline
Mosets'd
 
Join Date: Nov 2006
Posts: 805
Thumbs up

Hope it will be supported in the new core of HP b5 that is coming out soon...
__________________
Success in the long run Its not about the code its about the people and community that's make it!
  #20  
Old 09-08-2009, 04:24 PM
jamus jamus is offline
Member
 
Join Date: Jun 2009
Posts: 65
Default

That would be good. But it doesn't help those in production right now.
  #21  
Old 09-17-2009, 07:45 AM
cpontikos cpontikos is offline
Mosets'd
 
Join Date: Mar 2009
Posts: 4
Default 90% working sef_ect.php file for HP 1.0

Hello.

I have a 90% working sef_ext.php file for HP 1.0.

I am stuck, however, with the 'sorting' options like when sorting ascending / descending and with the limit and limitstart.

I think i know the problem and it may be because i am not able to get the configuration variables pulled in.

In the 'old' sef_ext.php file, there are the following statements to get the configuration variables:

# Include the config file
global $mosConfig_absolute_path;
require( $mosConfig_absolute_path.'/administrator/components/com_hotproperty/config.hotproperty.php' );

For the new Joomla 1.5 i have added the following (not sure if this is correct though):

# Include the config file
require_once( JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_hotproperty' . DS . 'includes' . DS . 'defines.php' );
require_once( HOTPROPERTY_CONFIGURATION );
global $hpconf;
$hpconf = new HotpropertyConfiguration();

Also, in the old sef_ext.php file, you call the variables like this (example):

global $hp_default_limit;
$limit = $hp_default_limit;

Anyone know how it should be done in the new Joomla 1.5?

If somebody can assist me with my problems, i will make the new sef_ext.php file available for everyone to use. It works great so far, i have pretty much ALL the url's SEF and for properties, they include the property item id, so there is no problem with duplicate property names.

Examples of a SEF property URL :

/hotproperty/property/3/apartment/test.html
/hotproperty/property/6/villa/test.html


Examples of SEF type URL:

/hotproperty/property/apartment.html
/hotproperty/property/villa.html

The word 'hotproperty' in the URL can be changed in SEF Advanced by adding a string to replace it with something else. For exmaple, the word can be changed to 'listings' so URL's end up like this:

/listings/property/apartment.html
/listings/property/villa.html

I am not an expert in Joomla 1.5, but i have got far with my own sef_ext.php file. All i need now is help with the asc / desc / limit / limitstart in the URL's and it will be good to use. I promise i will share it if someone can help me.

Emir from sakic.net has been very helpful with my questions and has also made a small change to the latest version of SEF Advance 2008 for HP too.

Please can someone assist me and we can all benefit from the sef_ext.php file i made so far.

If a HP developer wants the file i made so far, they can message me and i will send it to them. All i want is to get the limit / limitstart stuff sorted out and then the file will be perfect.

Thanks in advance!

Last edited by cpontikos; 09-17-2009 at 07:52 AM. Reason: typos
  #22  
Old 09-18-2009, 05:29 AM
jamus jamus is offline
Member
 
Join Date: Jun 2009
Posts: 65
Default

What happens to the URL when the pages are sorted? Is this a massive problem? Sound like you have done all the hard work to me.

I'd love to help but I've only been hacking HP around for a few weeks.
  #23  
Old 10-05-2009, 05:24 PM
jamus jamus is offline
Member
 
Join Date: Jun 2009
Posts: 65
Default

I can confirm that my installation of HP 1.0 v4 has SEF urls after installing ARTIO JoomSEF & Hot Property plugin for ARTIO.

I had to ask them to set it up as I found the documentation confusing but it seems to work well. The Url's now look like this:

domain.co.uk/find-a-home/propertytype/propertyname

You can elect to remove the proprty type or add the id too.

Hope this info helps someone out.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Open Source Solution was awarded to Mambo: Mambo 4.5.1a! dknight Announcements 0 02-16-2005 11:27 AM


All times are GMT +8. The time now is 04:16 AM.

Copyright © 2005-2010 Mosets Consulting

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.