Difference between revisions of "Variables you can use in theme files"
From JReviews Documentation
(→Conditionals) |
|||
Line 27: | Line 27: | ||
|- | |- | ||
| <source lang="php"><?php echo $Time->nice($listing['Listing']['modified']);?></source> || Modified date | | <source lang="php"><?php echo $Time->nice($listing['Listing']['modified']);?></source> || Modified date | ||
− | |||
− | |||
|- | |- | ||
| <source lang="php"><?php echo $listing['Listing']['section_id'];?></source> || Section ID (Joomla 1.5 only) | | <source lang="php"><?php echo $listing['Listing']['section_id'];?></source> || Section ID (Joomla 1.5 only) | ||
Line 34: | Line 32: | ||
| <source lang="php"><?php echo $listing['Section']['title'];?></source> || Section Title (Joomla 1.5 only) | | <source lang="php"><?php echo $listing['Section']['title'];?></source> || Section Title (Joomla 1.5 only) | ||
|- | |- | ||
− | | <source lang="php"><?php echo $listing[' | + | | <source lang="php"><?php echo $listing['Category']['cat_id'];?></source> || Category ID |
|- | |- | ||
| <source lang="php"><?php echo $listing['Category']['title'];?></source> || Category Title | | <source lang="php"><?php echo $listing['Category']['title'];?></source> || Category Title | ||
+ | |||
+ | |- | ||
+ | | <source lang="php"><?php echo $listing['Directory']['dir_id'];?></source> || Directory ID | ||
+ | |||
|- | |- | ||
| <source lang="php"><?php echo $listing['Directory']['title'];?></source> || Directory Title | | <source lang="php"><?php echo $listing['Directory']['title'];?></source> || Directory Title | ||
+ | |- | ||
+ | | <source lang="php"><?php echo $listing['Criteria']['criteria_id'];?></source> || Listing Type ID | ||
+ | |- | ||
+ | | <source lang="php"><?php echo $listing['Criteria']['title'];?></source> || Listing Type Title | ||
+ | |||
|- | |- | ||
| <source lang="php"><?php echo $listing['User']['user_id'];?></source> || Listing author's ID | | <source lang="php"><?php echo $listing['User']['user_id'];?></source> || Listing author's ID | ||
Line 45: | Line 52: | ||
|- | |- | ||
| <source lang="php"><?php echo $listing['User']['username'];?></source> || Listing author's username | | <source lang="php"><?php echo $listing['User']['username'];?></source> || Listing author's username | ||
+ | |||
+ | |- | ||
+ | | <source lang="php"><?php echo $listing['User']['email'];?></source> || Listing author's email | ||
|- | |- | ||
| <source lang="php"><?php echo $listing['Review']['user_rating'];?></source> || User rating | | <source lang="php"><?php echo $listing['Review']['user_rating'];?></source> || User rating |
Revision as of 09:36, 23 March 2013
$listing array
- The $listing array contains all the data of a certain listing
- It is used in these files:
- /listings/detail.thtml
- /listings/listings_blogview.thtml
- /listings/listings_tableview.thtml
- /listings/listings_thumbview.thtml
- /modules/listings.thtml
<?php echo $listing['Listing']['listing_id'];?> |
Listing ID |
<?php echo $listing['Listing']['title'];?> |
Listing Title |
<?php echo $listing['Listing']['summary'];?> |
Listing summary text |
<?php echo $listing['Listing']['description'];?> |
Listing description text |
<?php echo $listing['Listing']['text'];?> |
Summary + Description |
<?php echo $listing['Listing']['hits'];?> |
Number of visits |
<?php echo $Time->nice($listing['Listing']['created']);?> |
Created date |
<?php echo $Time->nice($listing['Listing']['modified']);?> |
Modified date |
<?php echo $listing['Listing']['section_id'];?> |
Section ID (Joomla 1.5 only) |
<?php echo $listing['Section']['title'];?> |
Section Title (Joomla 1.5 only) |
<?php echo $listing['Category']['cat_id'];?> |
Category ID |
<?php echo $listing['Category']['title'];?> |
Category Title |
<?php echo $listing['Directory']['dir_id'];?> |
Directory ID |
<?php echo $listing['Directory']['title'];?> |
Directory Title |
<?php echo $listing['Criteria']['criteria_id'];?> |
Listing Type ID |
<?php echo $listing['Criteria']['title'];?> |
Listing Type Title |
<?php echo $listing['User']['user_id'];?> |
Listing author's ID |
<?php echo $listing['User']['name'];?> |
Listing author's real name |
<?php echo $listing['User']['username'];?> |
Listing author's username |
<?php echo $listing['User']['email'];?> |
Listing author's email |
<?php echo $listing['Review']['user_rating'];?> |
User rating |
<?php echo $listing['Review']['user_rating_count'];?> |
Number of user ratings |
<?php echo $listing['Review']['review_count'];?> |
Number of user reviews |
<?php echo $listing['Review']['editor_rating'];?> |
Editor rating |
<?php echo $listing['Review']['editor_rating_count'];?> |
Number of editor ratings |
<?php echo $listing['Review']['editor_review_count'];?> |
Number of editor reviews |
<?php echo $listing['Favorite']['favored'];?> |
Number of users who added listing to their favorite list |
Conditionals
You can use any of the above variables to create conditionals, for example:
<?php if($listing['Review']['review_count']): // if user review exists ?> // display something <?php else: ?> // display something else <?php endif;?>