Advertisement:

Author Topic: (solved)italy theme mark PREMIUM ads  (Read 3418 times)

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
(solved)italy theme mark PREMIUM ads
« on: December 12, 2013, 12:00:28 am »
how to display the marked  ads premium italy  theme  osclass3.2.2
hi anyone wants to help me?
thank you good wishes expressed
« Last Edit: December 28, 2013, 09:58:14 pm by romantica »

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #1 on: December 20, 2013, 12:14:17 pm »
hi anyone wants to help me?

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: italy theme mark PREMIUM ads
« Reply #2 on: December 22, 2013, 06:28:46 pm »
@romantica

You can use while loop that is very easy:
Code: [Select]
while(osc_has_premiums) {
  .... some code here ....
}

This site will help you much to progress:
http://doc.osclass.org/HPremium.php

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #3 on: December 22, 2013, 10:05:24 pm »
hello thank you for your answer, this object code must be put where?
thank you
cordially

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: italy theme mark PREMIUM ads
« Reply #4 on: December 22, 2013, 10:48:13 pm »
@romantica
Wherever you need it, you can inspire by code for latest listings on homepage (main.php)

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #5 on: December 23, 2013, 01:00:15 am »
I thank you and I would see you

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #6 on: December 28, 2013, 11:41:18 am »
hello, thank you I found how to view premium ads, only that there are two ads posted on 4.
or to change the number of premium ads?
thank you

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: italy theme mark PREMIUM ads
« Reply #7 on: December 28, 2013, 02:32:19 pm »
@romantica
Can you post block of code that shows premium listings? You need to do only small modification.

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #8 on: December 28, 2013, 03:59:24 pm »
ok what file you want to see?

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: italy theme mark PREMIUM ads
« Reply #9 on: December 28, 2013, 04:01:55 pm »
@romantica

Quote
hello, thank you I found how to view premium ads, only that there are two ads posted on 4.

Post the code that make this

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #10 on: December 28, 2013, 05:27:26 pm »
ok:
Code: [Select]
<?php
    
/*
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2012 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */

    
osc_get_premiums();
    if(
osc_count_premiums() > 0) {
?>

<table border="0" cellspacing="0">
     <tbody>
        <?php $class "even"?>
        <?php while(osc_has_premiums()) { ?>
            <tr class="premium_<?php echo $class?>">
                <?php if( osc_images_enabled_at_items() ) { ?>
                 <td class="photo">
                     <?php if(osc_count_premium_resources()) { ?>
                        <a href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
                    <?php } else { ?>
                        <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" title="" alt="" />
                    <?php ?>
                 </td>
                 <?php ?>
                 <td class="text">
                     <h3>
                         <span style="float:left;"><a href="<?php echo osc_premium_url(); ?>"><?php echo osc_highlightstrip_tagsosc_premium_title() ) ); ?></a></span><span style="float:right;"><?php _e("Annuncio Premium""italia"); ?></span>
                     </h3>
                     <p style="clear: left;">
                         <strong><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { echo osc_premium_formated_price(); ?> - <?php } echo osc_premium_city(); ?> (<?php echo osc_premium_region(); ?>) - <?php echo osc_format_date(osc_premium_pub_date()); ?></strong>
                     </p>
                     <p><?php echo osc_highlightstrip_tagsosc_premium_description() ) ); ?></p>
                 </td>
             </tr>
            <?php $class = ($class == 'even') ? 'odd' 'even'?>
        <?php ?>
    </tbody>
</table>
<?php ?>
<table border="0" cellspacing="0">
    <tbody>
        <?php $class "even"?>
        <?php while(osc_has_items()) { ?>
            <tr class="<?php echo $class?>">
                <?php if( osc_images_enabled_at_items() ) { ?>
                 <td class="photo">
                     <?php if(osc_count_item_resources()) { ?>
                        <a href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
                    <?php } else { ?>
                        <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" title="" alt="" />
                    <?php ?>
                 </td>
                 <?php ?>
                 <td class="text">
                     <h3>
                         <a href="<?php echo osc_item_url(); ?>"><?php echo osc_highlightstrip_tagsosc_item_title() ) ); ?></a>
                     </h3>
                     <p>
                         <strong><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { echo osc_item_formated_price(); ?> - <?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>

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: italy theme mark PREMIUM ads
« Reply #11 on: December 28, 2013, 05:49:58 pm »
@romantica
Great, now change it to:

Code: [Select]
<?php
    
/*
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2012 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */

    
osc_get_premiums();
    if(
osc_count_premiums() > 0) {
?>

<table border="0" cellspacing="0">
     <tbody>
        <?php $class "even"?>
        <?php $counter 1;
        <?
php while(osc_has_premiums() and $counter <=2) { ?>

            <?php $counter $counter 1;
            <
tr class="premium_<?php echo $class; ?>
">
                <?php if( osc_images_enabled_at_items() ) { ?>
                 <td class="photo">
                     <?php if(osc_count_premium_resources()) { ?>
                        <a href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
                    <?php } else { ?>
                        <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" title="" alt="" />
                    <?php ?>
                 </td>
                 <?php ?>
                 <td class="text">
                     <h3>
                         <span style="float:left;"><a href="<?php echo osc_premium_url(); ?>"><?php echo osc_highlightstrip_tagsosc_premium_title() ) ); ?></a></span><span style="float:right;"><?php _e("Annuncio Premium""italia"); ?></span>
                     </h3>
                     <p style="clear: left;">
                         <strong><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { echo osc_premium_formated_price(); ?> - <?php } echo osc_premium_city(); ?> (<?php echo osc_premium_region(); ?>) - <?php echo osc_format_date(osc_premium_pub_date()); ?></strong>
                     </p>
                     <p><?php echo osc_highlightstrip_tagsosc_premium_description() ) ); ?></p>
                 </td>
             </tr>
            <?php $class = ($class == 'even') ? 'odd' 'even'?>
        <?php ?>
    </tbody>
</table>
<?php ?>
<table border="0" cellspacing="0">
    <tbody>
        <?php $class "even"?>
        <?php while(osc_has_items()) { ?>
            <tr class="<?php echo $class?>">
                <?php if( osc_images_enabled_at_items() ) { ?>
                 <td class="photo">
                     <?php if(osc_count_item_resources()) { ?>
                        <a href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
                    <?php } else { ?>
                        <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" title="" alt="" />
                    <?php ?>
                 </td>
                 <?php ?>
                 <td class="text">
                     <h3>
                         <a href="<?php echo osc_item_url(); ?>"><?php echo osc_highlightstrip_tagsosc_item_title() ) ); ?></a>
                     </h3>
                     <p>
                         <strong><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { echo osc_item_formated_price(); ?> - <?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>



You can see that there is modification only in 3 lines:
<?php $counter = 1;
<?php while(osc_has_premiums() and $counter <=2) { ?>
<?php $counter = $counter + 1;

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #12 on: December 28, 2013, 05:55:24 pm »
ok changes in three lines, to show all feature ads?

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: italy theme mark PREMIUM ads
« Reply #13 on: December 28, 2013, 06:09:33 pm »
@romantica

To set limit on premiums change this line:
$counter <= 2

More precisely, change 2 to number you want/need

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: italy theme mark PREMIUM ads
« Reply #14 on: December 28, 2013, 06:13:05 pm »
@frosticek

ok thank you understood, you have helped me!
cordially