|
|
#1 |
|
Senior Member
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 13 ![]() |
I'm new to php. Could someone please tell me why this doesn't work. Cat Id 17 & 18 are the two cats in autos (2wd & 4wd).
PHP Code:
Thanks,
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 13 ![]() |
I also added this to the last part of category.php
PHP Code:
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
|
|
|
|
#3 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,567
Rep Power: 45 ![]() ![]() |
Kirk,
I don't know php either, but I have done a lot of modding to my site (Thanks to much help from others in this forum) that is specific to different categories/subcategories. Calls that are made specifically to the category ids will only work within specific files (mainly the non-template files. eg: viewlisting.php vs viewlisting.tpl.php) The template files are usually sent data within an array that don't correlate to what's in the database. So the first question that the php gurus on here are going to need to be able to help is, what file are you inserting this php code into? -Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 13 ![]() |
Yes, that would be a useful bit of information, wouldn't it. Viewlistings.tpl.php. The idea is that if the ad is for a auto the link shows up.
I'm under the impression that since the tpl files are php pages, they are parsed like any other php file. The large amount of html they contain is just ignored by the "php engine?" and appeals to the browser which ignores the php code. I'm thinking that I may have to tell category.php to look at viewlistings.tpl.php for the if statement.
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
|
|
|
|
#5 |
|
Moderator
|
I'm not sure I get what you are wanting to do, I'll have to read again. However, I will explain how the template system works.
While they are php files they are not processed like regular php files. What happens is you assign variables via smarty assign in the core file like category.php. Then when the page is called smarty complies the code from the core file with the template control structures and variables, then it is rendered into html for the browser. For a better understanding open one of the compiled template files located in templates_c folder.
__________________
John Snyder PHP Developer |
|
|
|
|
|
#6 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,567
Rep Power: 45 ![]() ![]() |
Kirk,
Yes, the template file is a php file and it is parsed, however at the point that you reach the template file the information is being passed in arrays. You can verify that by placing {debug} in the layout.tpl.php file and then going to the appropriate page. I had this exact same issue myself. I believe that you would need to do what I did, which is to actually create a different viewlisting.tpl.php file for the category(s) that you are wanting the different information displayed in. I am using a custom viewlisting template pages for my categories, announcements, all subcategories in Real Estate and all subcategories in Vehicles. The key is in the viewlisting.php file (Where it is still retrieving directly from the DB instead of a "smarty" array). In the viewlisting.php file is where the calls to the DB are for the actual category id. If you go to this thread that I started a while back, you can see the logic and the final solution. Different template for categories? I hope this helps and if you need more specific information as to how I resolved this after understanding let me know. (You can follow the link to my site and see a live listing in the Real Estate >> For Rent to see the new opportunities that this opens) -Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 13 ![]() |
I don't have time to read that thread now, gotta go to work, but I will tonight.
I was hoping to avoid separate viewlisting tpls, but that will probably give me what I want. Which seems to be what you did. Do I have to have a separate viewlisting.php for each viewlisting.tpl.php? I tried to place this link (original post) as an option in an extra field in admin, but it didn't work out. If you've (Mike) had success with separate viewlisting tpls, I'll probably have some more questions for you. I was hoping that V4 would have a drop down for all fields (not just extras) to assign to cats. Thanks,
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 13 ![]() |
Mike,
Do you also have custom usercheckout templates? I would think for step 3 you would have custom tpls to fill the custom fields. I looked at an apartment rental ad on your site and it's what I'm looking to do, just not as much info. I'm surprised there aren't more people wanting to do that. Thanks,
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
|
|
|
|
#9 | ||
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,567
Rep Power: 45 ![]() ![]() |
Quote:
Quote:
You only need to modify the original viewlisting.php file and then within that modification code include a separate line for each category ID that you want a separate viewlisting.tpl.php file for. -Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to display category total listings? | dankellaway | v3.1 Questions & Support | 2 | 03-13-2007 01:25 PM |
| Only display main cats in category drop down? | wiredhat | v3.1 Questions & Support | 10 | 02-07-2007 02:59 PM |
| Yahoo Maps - I can not get it to display link | redmtnex | v3.1 Modules & Modifications | 15 | 01-23-2007 11:09 PM |
| ad is about to expire link | garysmith | v3.1 Questions & Support | 3 | 06-14-2006 06:27 PM |
| How to Easily Find Link to "My Store" | hppenterprises | v3.1 Questions & Support | 6 | 06-02-2006 10:23 AM |