| Server IP : 172.67.178.83 / Your IP : 216.73.217.141 Web Server : Apache System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64 User : corbizre ( 1013) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/corbizre/findnextproperty.com/frontend/components/ |
Upload File : |
<?php
namespace frontend\components;
use console\models\Housestable;
use yii\helpers\BaseArrayHelper;
use Yii;
use yii\helpers\Html;
/*
$model->Address - house address
$model->State - state
$model->City - city
$model->Zip - zip
$model->Description - house description
$model->Address - address house
SetMeta - editor for one house
SetMetaForState - editor for state
SetMetaForCity - editor for City
SetMetaForZip - editor for Zip
setCommon - editor for other pages as default
*/
class SeoHelper extends BaseArrayHelper
{
// editor for one house (exmpl: http://realestatenetwork.loc/view/200-coulson-lane-crescent-city-ca-95531-del-norte-county.html)
public static function SetMeta($arr = null)
{
if ($arr) {
$model = Housestable::gethouseBySlug($arr['slug']);
$model->Description = $model->Description ? trim(unserialize($model->Description)) : $model->Address;
//////// you can edit here /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$title = $model->Address; // you can edit here exmpl : $model->Address .' '. $model->State .' '. $model->City .' '. $model->Zip
$description = $model->Description;
$keywords = $model->Address . ', ' . $model->State . ', ' . $model->City . ', ' . $model->Zip; // например : $model->Address ', ' $model->State ', ' $model->City ', ' $model->Zip
//////// end ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<title><?= $title; ?></title>
<meta name="Description" content="<?= $description; ?>">
<meta name="Keywords" content="<?= $keywords; ?>">
<meta name="Robots" content="ALL">
<meta name="Revisit-After" content="1 Days">
<meta name="copyright" content="estatearcheology.com">
<?
} else {
$AllOtherCases = new self;
$AllOtherCases->setCommon();
}
}
// editor for state (exmpl:california)
public static function SetMetaForState($state = null)
{
if ($state) {
$fullStateName = StateHelper::getStateName($state);
$stateModel = Housestable::getRelatedHousesByState($state,false,15);
$arrCities = CityHelper::getCityListByState($stateModel);
$strListCitys = CityHelper::SetAsStringCities($arrCities);
//////// you can edit here //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$title = $fullStateName." real estate listings database. ".$state." properties"; // you can edit here
$description = $state." real estate listings. Realestate for sale, rent in ".$fullStateName; // you can edit here
$keywords = $state.",".$strListCitys;// you can edit here
//////// end ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<title><?= $title; ?></title>
<meta name="Description" content="<?= $description; ?>">
<meta name="Keywords" content="<?= $keywords; ?>">
<meta name="Robots" content="ALL">
<meta name="Revisit-After" content="1 Days">
<meta name="copyright" content="estatearcheology.com">
<? } else {
$AllOtherCases = new self;
$AllOtherCases->setCommon();
}
}
// editor for city (exmpl: http://realestatenetwork.loc/list/ca/los-angeles)
public static function SetMetaForCity($state=null,$city = null)
{
if ($state && $city) {
$fullStateName = StateHelper::getStateName($state); // Full state name exmp:(California)
//////// you can edit here //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$title = $fullStateName. ' ' . $city. " real esate listings"; //you can edit here
$description = "Search real estate for sale and rent in ".$city." ".$fullStateName; // you can edit here
$keywords = $fullStateName. ', ' .$city.",real estate,".$state; // you can edit here
//////// end ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<title><?= $title; ?></title>
<meta name="Description" content="<?= $description; ?>">
<meta name="Keywords" content="<?= $keywords; ?>">
<meta name="Robots" content="ALL">
<meta name="Revisit-After" content="1 Days">
<meta name="copyright" content="estatearcheology.com">
<?
} else {
$AllOtherCases = new self;
$AllOtherCases->setCommon();
}
}
// editor for zip (exmpl: http://realestatenetwork.loc/list/ca/los-angeles/889888)
public static function SetMetaForZip($state=null,$city = null,$zip=null)
{
if ($state && $city && $zip) {
$fullStateName = StateHelper::getStateName($state); // Full state name exmp:(California)
//////////editor for zip //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$title = $city.', '. $zip.",".$state." real estate listings"; // you can edit here
$description = $city.', '.$state." ".$zip." free real estate database"; // you can edit here
$keywords = $fullStateName. ', ' . $city.', '. $zip; // you can edit here
//////// end ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<title><?= $title; ?></title>
<meta name="Description" content="<?= $description; ?>">
<meta name="Keywords" content="<?= $keywords; ?>">
<meta name="Robots" content="ALL">
<meta name="Revisit-After" content="1 Days">
<meta name="copyright" content="estatearcheology.com">
<?
} else {
$AllOtherCases = new self;
$AllOtherCases->setCommon();
}
}
// COMMON PAGE FOR ALL SITE!!!
public function setCommon()
{
//////// you can edit here ////////////COMMON PAGE FOR ALL SITE!!!///////////////////////////////////////////////////////////////////////////////////////////////////////////////// ?>
<title><?= Yii::$app->name ?></title> <?// you can edit here ?>
<meta name="description"content="<?= Yii::$app->name ?> - We bring you New and Old Properties of United States "><? // you can edit here ?>
<meta name="keywords" content="Properties, Apartaments, Bungalows, Condominium, Villas"><? // you can edit here ?>
<? //////// end you can edit here end /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ?>
<meta name="Robots" content="ALL">
<meta name="Revisit-After" content="1 Days">
<meta name="copyright" content="estatearcheology.com">
<?
}
}