Advertisement:

Author Topic: 2 Easy questions!  (Read 3020 times)

giovastrovas

  • Newbie
  • *
  • Posts: 10
2 Easy questions!
« on: May 13, 2013, 08:08:55 pm »
Hi, i have 2 easy questions if any one can help me.

The first one is that i wanted only the premium ads to appear on the main.php page. What i did was the following, i copied the code from search_list.php and overwrote the actual code on main.php. The problem is that everything is good but the ads dont have the gold frame around them, they just look the same as the free ads. This is the actual code:

Code: [Select]
<div class="search-header span11 columns">
                <h3><?php _e('Latest Items''twitter') ; ?></h3>
                <?php if( osc_count_latest_items() == 0) { ?>
                <p>
                    <?php _e('No Latest Items''twitter') ; ?>
                </p>
                <?php } else { ?>
               
                    <?php
    osc_get_premiums
() ;
    if( 
osc_count_premiums() > ) {
?>

<?php while ( osc_has_premiums() ) { ?>
    <div class="premium line span11 columns">
        <div class="photo">
        <?php if( osc_count_premium_resources() ) { ?>
            <a href="<?php echo osc_premium_url() ; ?>">
                <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="100px" height="75px" title="<?php echo osc_premium_title(); ?>" alt="<?php echo osc_premium_title(); ?>" />
            </a>
        <?php } else { ?>
            <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>
        <?php ?>
        </div>
        <div class="description">
            <h3><?php if( osc_price_enabled_at_items() ) { ?> <small><strong><?php echo osc_premium_formated_price() ; ?></strong></small> &middot; <?php ?><a href="<?php echo osc_premium_url() ; ?>"><?php echo osc_premium_title(); ?></a> <span class="label"><a href="<?php echo osc_item_category_urlosc_premium_category_id() ) ; ?>"><?php echo osc_premium_category() ; ?></a></span></h3>
            <p><?php printf(__('<strong>Publish date</strong>: %s''twitter'), osc_format_dateosc_premium_pub_date() ) ) ; ?></p>
            <?php
                $location 
= array() ;
                if( 
osc_premium_country() != '' ) {
                    
$location[] = sprintf__('<strong>Country</strong>: %s''twitter'), osc_premium_country() ) ;
                }
                if( 
osc_premium_region() != '' ) {
                    
$location[] = sprintf__('<strong>Region</strong>: %s''twitter'), osc_premium_region() ) ;
                }
                if( 
osc_premium_city() != '' ) {
                    
$location[] = sprintf__('<strong>City</strong>: %s''twitter'), osc_premium_city() ) ;
                }

                if( 
count($location) > 0) { ?>

                    <p><?php echo implode(' &middot; '$location) ; ?></p>
                <?php ?>
            <p><?php echo osc_highlightstrip_tagsosc_premium_description() ) ) ; ?></p>
        </div>
    </div>
    <?php ?>
<?php ?>
                    <?php if( osc_count_premiums() == osc_max_latest_items() ) { ?>
                    <div class="row show-all-ads">
                        <div class="span12 columns">
                            <a class="btn primary" href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'twitter') ; ?> &raquo;</strong></a>
                        </div>
                    </div>
                    <?php ?>
                <?php ?>
            </div>
            </div>
        <?php osc_current_web_theme_path('footer.php') ; ?>

If im not mistaken the <div class="premium line span11 columns"> is the one that gives the gold color to the ad, but its not working, else i dont know what im doing wrong!

Second thing is that i want that after my users log in using the login page, they are automatically redirected to the paypal item details, if im not mistaken i have to change something in the login.php page in order to change the page from redirecting to the dashboard to redirecting to the paypal item page.

Any help will be appreciated THANKS!!

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: 2 Easy questions!
« Reply #1 on: May 13, 2013, 08:25:46 pm »
Code: [Select]
<div class="premium line span11 columns">
Hard to be sure not knowing your css, but there are four different classes here, it might be possible that the latest three are overwriting premium's declarations. ??? Just in case try:

1.- Moving .premium rule to the end of your .css if all four classes rules are declared in the same file,

or

2.- Changing its order of loading if they are in different .css files (the file including .premium rule should be loaded last)

Regards

giovastrovas

  • Newbie
  • *
  • Posts: 10
Re: 2 Easy questions!
« Reply #2 on: May 13, 2013, 08:30:02 pm »
Totally right im really sorry forgot to put that, im using twitter theme.
Thanks for the reply ill try that right now, ill look the css! thanks!

giovastrovas

  • Newbie
  • *
  • Posts: 10
Re: 2 Easy questions!
« Reply #3 on: May 13, 2013, 08:37:48 pm »
Still not working :/ in the css i found the .search .content .premium and i moved to the end of the file and nothing happend, the weird part is that when i look the items using the categories bar, and it lists all the ads on that category it does show me the ads with the gold color. any suggestions??

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: 2 Easy questions!
« Reply #4 on: May 13, 2013, 08:44:42 pm »
If you're not working in localhost, PM me the URL and I'll take a look at it.

Regards

giovastrovas

  • Newbie
  • *
  • Posts: 10
Re: 2 Easy questions!
« Reply #5 on: May 13, 2013, 08:54:54 pm »
I already sent you the url via PM thanksss!

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: 2 Easy questions!
« Reply #6 on: May 13, 2013, 10:32:51 pm »
Seen and problem found, see attachment please.

In a nutshell, your .premium rule is being declared just for the Search page:

.search .content .premium {  [premium_declarations]
}

You want to apply that same rule to .latest_ads.container .line:

Code: [Select]
.latest_ads.container .line .premium {
    padding: 10px;
    width: 620px;
    background-color: rgb(238, 220, 148);
    background-repeat: repeat-x;
    background-image: -moz-linear-gradient(center top , rgb(252, 238, 193), rgb(238, 220, 148));
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
    text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5);
    border-width: 1px;
    border-style: solid;
    border-radius: 4px 4px 4px 4px;
    box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.25) inset;
}

Also, you could simply stablish a general rule .premium...

.premium {  [premium_declarations]
}

...that would be applied to any element with class premium on your site, but that tends to provoke further problems, so better keep the things compartmentalized. ;)

Regards



giovastrovas

  • Newbie
  • *
  • Posts: 10
Re: 2 Easy questions!
« Reply #7 on: May 14, 2013, 01:26:23 am »
Thanks for your help Teseo!
I solved the color problem, i dont know exactly if what i did is correct.
What i did is the following:
First i added the css lines you provided me to the custom.css, and by some misterious thing it didnt work.
What i did after that is that i changed my main.php page, there was this line

Code: [Select]
<!-- content -->       
        <div class="container container-fluid latest_ads">

What i did is that i addded "search" to it:

Code: [Select]
<!-- content -->       
        <div class="container container-fluid latest_ads search">

If im not mistaken what it does is that it calls all the css rules from the search part in the custom.css file.

And now its working! Again im not really sure if this is the correct way but its working.
Any thoughts will be welcomed!

Thanks again Teseo!

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: 2 Easy questions!
« Reply #8 on: May 14, 2013, 01:50:11 am »
Well, is important that you understand why is working this way. Yes, you added the class search to the div, that was working for the search page, and it worked for main).

The only problem is what I said before (curándome en salud, como se suele decir  ;D ):

Quote
but that tends to provoke further problems, so better keep the things compartmentalized

Now that you know you have a solution in any case, my advice is that you should take a moment to get back and try to do it more neatly. You sent me by PM a copy of your css and I couldn't see that new rule there. ??? If properly inserted, it should work fine.

I know, it's a pain in the ass  :D but I assure you good practices will save you a lot of time in the future. ;)

Regards