php - How to utilize the functions of OSClass? -
i want create new .php file , want utilize functions within osclass codex. instance code won't work because haven't imported functions , dependencies. how accomplish this.
<?php osc_query_item("region_name=madrid"); if( osc_count_custom_items() == 0) { ?> <p class="empty"><?php _e('no listings', 'modern') ; ?></p> <?php } else { ?> <table border="0" cellspacing="0"> <tbody> <?php $class = "even"; ?> <?php while ( osc_has_custom_items() ) { ?> <tr class="<?php echo $class. (osc_item_is_premium()?" premium":"") ; ?>"> <?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') ; ?>" alt="" title=""/> <?php } ?> </td> <?php } ?> <td class="text"> <h3><a href="<?php echo osc_item_url() ; ?>"><?php echo osc_item_title() ; ?></a></h3> <p><strong><?php if( osc_price_enabled_at_items() ) { 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_highlight( strip_tags( osc_item_description() ) ) ; ?></p> </td> </tr> <?php $class = ($class == 'even') ? 'odd' : 'even' ; ?> <?php } ?> </tbody> </table> <?php }; ?>
what you'll want custom page. in osclass, custom pages brought plugins. if need tutorial creating plugin in osclass 3.3+, here's 1 : how create plugins osclass.
-
if curious osclass internals, osclass functions (helpers) loaded in /oc-load.php
@ root of installation.
Comments
Post a Comment