Advertisement:

Author Topic: [Solved] dynamic_homepage.php not showing categories/latest ads 2.4 upgrade  (Read 11565 times)

hallartistry

  • Full Member
  • ***
  • Posts: 133
 :o  Okay, I'm going nuts here! I upgraded to 2.4 from the last version and had all sorts of problems, coupled with the fact that I am needing to move my installation to replace my existing classifieds site.  So long story short, I just did a fresh install of the new version to my existing classifieds folder (the actual classifieds for that are in a subfolder).

Things seemed to be working well except that I have a dynamic homepage but the categories and ads are not showing up on it like they were before. I'm using Bcute theme. I had originally just replaced my content folder with the test site content folder where I had all my changes, but it wouldn't work. Then I tried starting from scratch making a new dynamic_homepage.php file and just copy and pasting my original code into it, but still nothing shows up except the header/footer info but not content info.

The same thing happens when I try to create a page from the admin panel. I am pulling my hair out trying to figure this out! I am so close to making my new script live and then this happens!  :-[   

As it is right now, I have it on maintenance mode, but I need to take it off maintenance soon before I lose too much business. It's not a huge site yet, but I usually have an average of one or two ads placed a day.
Anyway, sorry, I'm just so flustered right now lol

Here is the code for my dynamic_homepage.php Don't know if it will help:
Code: [Select]
text/x-generic dynamic_homepage.php
HTML document text

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_''-'osc_current_user_locale()) ; ?>">
    <head>
        <?php osc_current_web_theme_path('head.php') ; ?>
        <meta name="robots" content="index, follow" />
        <meta name="googlebot" content="index, follow" />
    </head>
    <body>
        <div class="containerbg">
            <div class="container">
                <?php osc_current_web_theme_path('header.php') ; ?>
                <div id="form_publish">
                    <?php osc_current_web_theme_path('inc.search.php') ; ?>

                </div>
                <div class="content home">
                    <div id="main">
                        <?php
                            $total_categories   
osc_count_categories() ;
                            
$col1_max_cat       ceil($total_categories/3);
                            
$col2_max_cat       ceil(($total_categories-$col1_max_cat)/2);
                            
$col3_max_cat       $total_categories-($col1_max_cat+$col2_max_cat);
                        
?>

                        <div class="categories <?php echo 'c' $total_categories ?>">
                            <?php osc_goto_first_category() ; ?>
                            <?php
                                $i      
1;
                                
$x      1;
                                
$col    1;
                                if(
osc_count_categories () > 0) {
                                    echo 
'<div class="col c1">';
                                }
                            
?>

                            <?php while ( osc_has_categories() ) { ?>
                                <div class="category">
                                    <h1><strong><span class="category <?php echo osc_category_slug() ; ?>"></span><a href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</span></strong></h1>
                                    <?php if ( osc_count_subcategories() > ) { ?>
                                        <ul>
                                            <?php while ( osc_has_subcategories() ) { ?>
                                                <li><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</span></li>
                                            <?php ?>
                                        </ul>
                                    <?php ?>
                                </div>
                                <?php
                                    
if (($col==&& $i==$col1_max_cat) || ($col==&& $i==$col2_max_cat) || ($col==&& $i==$col3_max_cat)) {
                                        
$i 1;
                                        
$col++;
                                        echo 
'</div>';
                                        if(
$x $total_categories) {
                                            echo 
'<div class="col c'.$col.'">';
                                        }
                                    } else {
                                        
$i++ ;
                                    }
                                    
$x++ ;
                                
?>

                            <?php ?>
                       </div>
                       <div class="latest_ads">
                            <h1><strong><?php _e('Latest Items''bcute') ; ?></strong></h1>
                            <?php if( osc_count_latest_items() == 0) { ?>
                                <p class="empty"><?php _e('No Latest Items''bcute') ; ?></p>
                            <?php } else { ?>
                                <table border="0" cellspacing="0">
                                     <tbody>
                                        <?php $class "even"?>
                                        <?php while ( osc_has_latest_items() ) { ?>
                                        <tr class="<?php echo osc_item_is_premium() ? 'premium_' $class $class ?>">
                                        <?php if( osc_images_enabled_at_items() ) { ?>
                                            <td class="photo">
                                                <?php if( osc_item_is_premium() ){ ?>
                                                <div id="premium_img"></div>
                                                <?php }?>
                                                <?php if( osc_count_item_resources() ) { ?>
                                                <a href="<?php echo osc_item_url() ; ?>">
                                                    <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="75px" height="56px" title="" alt="" />
                                                </a>
                                                <?php } else { ?>
                                                    <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>
                                                <?php ?>
                                            </td>
                                        <?php ?>
                                            <td class="text">
                                                <div class="price-wrap"><span class="tag-head"></span><p class="price"><?php if( osc_price_enabled_at_items() ) { echo osc_item_formated_price() ; ?></p></div>
                                                <h3><a href="<?php echo osc_item_url() ; ?>"><?php echo osc_item_title() ; ?></a></h3>
                                                <p><strong><?php } echo osc_item_city(); ?> (<?php echo osc_item_region();?>) - <?php echo osc_format_date(osc_item_pub_date()); ?></strong></p>
                                                <p><?php echo osc_highlightstrip_tagsosc_item_description() ) ) ; ?></p>
                                            </td>                                       
                                        </tr>
                                        <?php $class = ($class == 'even') ? 'odd' 'even' ?>
                                        <?php ?>
                                    </tbody>
                                </table>
                                <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
                                <p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'bcute'); ?> &raquo;</strong></a></p>
                                <?php ?>
                            <?php ?>
                        </div>
                    </div>
                    <div id="sidebar">
                        <div class="navigation">
                            <?php if(osc_count_list_cities()>0) {?>
                            <div class="box location">
                                <h3><strong><?php _e("Location"'bcute'); ?></strong></h3>
                                <ul>
                                <?php while(osc_has_list_cities()) { ?>
                                    <li><a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name();?></a> <em>(<?php echo osc_list_city_items();?>)</em></li>
                                <?php ?>
                                </ul>
                            </div>
                            <?php ?>
                        </div>
                    </div>
                </div>
            </div>
            <?php osc_current_web_theme_path('footer.php') ; ?>
        </div>
        <?php osc_show_flash_message() ; ?>
        <?php osc_run_hook('footer') ; ?>
    </body>
</html>

« Last Edit: May 08, 2012, 09:35:52 am by hallartistry »

hallartistry

  • Full Member
  • ***
  • Posts: 133
Okay, so I decided to try reverting back to 2.3.6 so I just uploaded and replaced all except the content folder and now it works! Any ideas what could be wrong with 2.4?

hallartistry

  • Full Member
  • ***
  • Posts: 133
Any ideas? Like I said above, it works since I changed back to 2.3.6. But when I upload version 2.4 the page switches to just having the title "Classifieds" as if it's just a custom page I made in the Admin area. It should have all the categories and latest ads on it instead. So I'm guessing that for some reason it is trying to read the page as if  I created a page in Admin, instead of the dynamic_homepage file that I created.

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Hi hallartistry,

I do not quite understand the dynamic homepage.php file can you explain more.

Jay

hallartistry

  • Full Member
  • ***
  • Posts: 133
Sorry about that.  It's so I can have a static home page and then have the classifieds categories and latest ads show up on another page (the dynamic_homepage) So anyway I got the idea from this post from Conejo: http://forums.osclass.org/plugins/%28new%29-static-home-page-plugin-699/   

hallartistry

  • Full Member
  • ***
  • Posts: 133
Still can't find a solution to this unless I just switch back to an older version. Any ideas anyone?

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
I think it is a bug in 2.4 as I tried to load a dynamic page and it did not load.

Jay

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Ok good new it is not a bug. To make your dynamic page load you need to change the file name to page-dynamic homepage.php and then you page will work again. They also just updated the wiki page for custom pages. http://doc.osclass.org/Create_custom_pages

Jay

hallartistry

  • Full Member
  • ***
  • Posts: 133
Alright! Thanks so much, works great now! I think I've finally got all my bugs worked out now :) 

asimshaz

  • Sr. Member
  • ****
  • Posts: 311
  • 01tec
@trains58554
great work