Loading


Author Topic: [TUTORIAL] How to make City and Regions specific main pages  (Read 17709 times)

computerbar

  • Tutor
  • Sr. Member
  • *
  • Posts: 256
    • Jamal.pk
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #45 on: June 16, 2013, 04:04:42 am »
Hello

Would you please update this tutorial to work with 3.1.2

I managed to create myhome , but I cant browse categories or filter it based on Region/City


Thank you

Quote
Hello

Regarding this tutorial

http://forums.osclass.org/tips-and-tricks/how-to-make-city-and-regions-specific-main-pages/

Would you please update it to version 3.1.2
I will really appreciate that.

Thank you


See first post....
« Last Edit: June 16, 2013, 05:24:16 am by computerbar »

Daniel1

  • Newbie
  • *
  • Posts: 5
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #46 on: June 17, 2013, 06:49:09 pm »
Hello

Thank you for your replay and update , but that didn't work for me either ( I tried it before I read your update )
could you please upload the required files , some of them in your post is 404

Thanks a lot

computerbar

  • Tutor
  • Sr. Member
  • *
  • Posts: 256
    • Jamal.pk
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #47 on: June 18, 2013, 12:05:34 am »
Hello

Thank you for your replay and update , but that didn't work for me either ( I tried it before I read your update )
could you please upload the required files , some of them in your post is 404

Thanks a lot
Hey there
There is nothing to upload here. what ever you need is on the first post.

I am happy to help if you ask it here....

what exactly is you are stuck with.
Upload your (index.php and myhome.php) from controller folder and myhome.php from theme folder...here and let see what is wrong with it.


amara

  • Newbie
  • *
  • Posts: 6
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #48 on: June 18, 2013, 05:03:54 pm »
Great Tut.

But i cant make it done as on your site i follow all instruction too

I have Osclass 3.1.2 i test it on localhost with theme bender

The issue is when i select any city eg. http://localhost/index.php?page=myhome&sCity=xyz

i redirect to http://localhost/xampp/ my files are

oc-content/themes/bender/myhome.php  (Copy of main.php)
oc-includes/osclass/controller/myhome.php (Copy of Search.php)

and with few tweaks as per your instruction index.php and main.php (In bender theme )

I tried on your instruction since last 1 week and also tried with your lest update.

Thanks


computerbar

  • Tutor
  • Sr. Member
  • *
  • Posts: 256
    • Jamal.pk
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #49 on: June 19, 2013, 12:18:37 am »
Great Tut.

But i cant make it done as on your site i follow all instruction too

I have Osclass 3.1.2 i test it on localhost with theme bender

The issue is when i select any city eg. http://localhost/index.php?page=myhome&sCity=xyz

i redirect to http://localhost/xampp/ my files are

oc-content/themes/bender/myhome.php  (Copy of main.php)
oc-includes/osclass/controller/myhome.php (Copy of Search.php)

and with few tweaks as per your instruction index.php and main.php (In bender theme )

I tried on your instruction since last 1 week and also tried with your lest update.

Thanks


I think it might be because of your xamp installation/folder..

try using full local url i.e. including http://localhost......

instead of below suggested (In tutorial I used it to be usable in any theme)

../index.php?page=myhome&sCity=<?php echo osc_search_city() ; ?>"><?php echo osc_search_city() ; ?></a>

amara

  • Newbie
  • *
  • Posts: 6
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #50 on: June 19, 2013, 12:11:39 pm »
Thanks for your reply..

I followed your interconnections in mail.php

<span>Your are in....<a href="../index.php?page=myhome&sCity=<?php echo osc_search_city() ; ?>"><?php echo osc_search_city() ; ?></a><a href="../index.php?page=myhome&sRegion=<?php echo osc_search_region() ; ?>"><?php echo osc_search_region() ; ?></a></span>

I upload all files on live site but unfortunately it wont work :(

site is running same as it default  please visit : http://goo.gl/TmBrP

i really need to make it DONE ASAP please help

Thanks Again

computerbar

  • Tutor
  • Sr. Member
  • *
  • Posts: 256
    • Jamal.pk
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #51 on: June 19, 2013, 05:40:33 pm »
Thanks for your reply..

I followed your interconnections in mail.php

<span>Your are in....<a href="../index.php?page=myhome&sCity=<?php echo osc_search_city() ; ?>"><?php echo osc_search_city() ; ?></a><a href="../index.php?page=myhome&sRegion=<?php echo osc_search_region() ; ?>"><?php echo osc_search_region() ; ?></a></span>

I upload all files on live site but unfortunately it wont work :(

site is running same as it default  please visit : http://goo.gl/TmBrP

i really need to make it DONE ASAP please help

Thanks Again


It looks OK to me.
The links from region/city are valid....
however you have made a copy of SEARCH.php in your theme folder instead of MAIN.php [unless it was intentional]

What is your question now? The links are working!!

I accept donations at computerbar at gmail.com if you need urgent help  8)
« Last Edit: June 19, 2013, 05:43:02 pm by computerbar »

amara

  • Newbie
  • *
  • Posts: 6
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #52 on: June 19, 2013, 09:41:38 pm »
What i need is

When user click on the City > Khanpur (12) than all the category on the main page
Only display result for the Khanpur as here 12 Business. Same for the other city's (I hope you are doing same on your site)

However i place again main.php and myhome.php in the theme folder and myhome.php is copy of main.php

But right now when i click on the city it just sort all business on one place without category.

Thanks for your help

computerbar

  • Tutor
  • Sr. Member
  • *
  • Posts: 256
    • Jamal.pk
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #53 on: June 20, 2013, 12:50:00 am »
What i need is

When user click on the City > Khanpur (12) than all the category on the main page
Only display result for the Khanpur as here 12 Business. Same for the other city's (I hope you are doing same on your site)

However i place again main.php and myhome.php in the theme folder and myhome.php is copy of main.php

But right now when i click on the city it just sort all business on one place without category.

Thanks for your help

assuming you have 3.1.x version

recheck your myhome.php in controller folder...
on line 386
$this->doView('search.php');

it should be myhome.php

if still not working
you should follow again the the tutorial and upload all the modified files to see what could be the problem...

amara

  • Newbie
  • *
  • Posts: 6
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #54 on: June 20, 2013, 11:03:18 am »
Thanks you are right i missing the  $this->doView('myhome.php');

I fix it and upload now on the city search it display advert in the city only.

that's good but i need almost same as on your site : http://jamal.pk/index.php?page=mylocal&sCity=Islamabad

you have category and main category based on city and in the advert you have related category link

I follow your first post again and sending you updated files in attachment.

Thanks Again for your time and great efforts on forum.

computerbar

  • Tutor
  • Sr. Member
  • *
  • Posts: 256
    • Jamal.pk
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #55 on: June 20, 2013, 01:00:11 pm »
Thanks you are right i missing the  $this->doView('myhome.php');

I fix it and upload now on the city search it display advert in the city only.

that's good but i need almost same as on your site : http://jamal.pk/index.php?page=mylocal&sCity=Islamabad

you have category and main category based on city and in the advert you have related category link

I follow your first post again and sending you updated files in attachment.

Thanks Again for your time and great efforts on forum.

Hi amara

I am glad it worked out for you.

About the categories bit.
the main.php you upload is not the one that is in your theme folder.. as it is missing the categories code.

Please follow the tutorial again restarting with original main.php in your theme folder.

The purspose of this tutorial was to share an idea.
Understand the concept and I am sure it will help you design your website the way you want.
You need to work on your CSS skill to design the website which is outside the scope of this tutorial.

 

amara

  • Newbie
  • *
  • Posts: 6
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #56 on: June 20, 2013, 03:11:45 pm »
Dear computerbar,

I Really appreciate your work and efforts your code and tut. is fine with modern theme code works fine here :  http://goo.gl/TmBrP .

And as i write in my first post i am using bender theme this is an html5 responsive theme this theme main.php is diffrent than modern.

I again start work as you guide with bender will sure upload code if i got success to make your code work with bender theme.

BTW here i upload the code for modern theme for the other users

Many Thanks

moinshaikh1726

  • Newbie
  • *
  • Posts: 3
    • Email
Re: [TUTORIAL] How to make City and Regions specific main pages
« Reply #57 on: November 18, 2014, 05:24:55 pm »
hi computer bar.............


i am success doing this tips ......... thank you so much.....

but i have little problem.....


how can i come back from ads page to home with selected city when i clicked to logo of my site, he is back but dropped city from home and displaying you are in :.......... like this..... how can i solve it.....................



computer bar pls help me