PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/sites/all/themes/titan/node--add_item.tpl.php

https://bitbucket.org/hjain/trinet
PHP | 252 lines | 127 code | 40 blank | 85 comment | 8 complexity | 6be9d5e3b8eb1b39bceecb7c11e13e63 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. // $Id: node.tpl.php,v 1.4 2011/01/10 13:46:19 jarek Exp $
  3. /**
  4. * @file
  5. * Default theme implementation to display a node.
  6. *
  7. * Available variables:
  8. * - $title: the (sanitized) title of the node.
  9. * - $content: An array of node items. Use render($content) to print them all, or
  10. * print a subset such as render($content['field_example']). Use
  11. * hide($content['field_example']) to temporarily suppress the printing of a
  12. * given element.
  13. * - $user_picture: The node author's picture from user-picture.tpl.php.
  14. * - $date: Formatted creation date. Preprocess functions can reformat it by
  15. * calling format_date() with the desired parameters on the $created variable.
  16. * - $name: Themed username of node author output from theme_username().
  17. * - $node_url: Direct url of the current node.
  18. * - $terms: the themed list of taxonomy term links output from theme_links().
  19. * - $display_submitted: whether submission information should be displayed.
  20. * - $classes: String of classes that can be used to style contextually through
  21. * CSS. It can be manipulated through the variable $classes_array from
  22. * preprocess functions. The default values can be one or more of the following:
  23. * - node: The current template type, i.e., "theming hook".
  24. * - node-[type]: The current node type. For example, if the node is a
  25. * "Blog entry" it would result in "node-blog". Note that the machine
  26. * name will often be in a short form of the human readable label.
  27. * - node-teaser: Nodes in teaser form.
  28. * - node-preview: Nodes in preview mode.
  29. * The following are controlled through the node publishing options.
  30. * - node-promoted: Nodes promoted to the front page.
  31. * - node-sticky: Nodes ordered above other non-sticky nodes in teaser listings.
  32. * - node-unpublished: Unpublished nodes visible only to administrators.
  33. * - $title_prefix (array): An array containing additional output populated by
  34. * modules, intended to be displayed in front of the main title tag that
  35. * appears in the template.
  36. * - $title_suffix (array): An array containing additional output populated by
  37. * modules, intended to be displayed after the main title tag that appears in
  38. * the template.
  39. *
  40. * Other variables:
  41. * - $node: Full node object. Contains data that may not be safe.
  42. * - $type: Node type, i.e. story, page, blog, etc.
  43. * - $comment_count: Number of comments attached to the node.
  44. * - $uid: User ID of the node author.
  45. * - $created: Time the node was published formatted in Unix timestamp.
  46. * - $classes_array: Array of html class attribute values. It is flattened
  47. * into a string within the variable $classes.
  48. * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
  49. * teaser listings.
  50. * - $id: Position of the node. Increments each time it's output.
  51. *
  52. * Node status variables:
  53. * - $view_mode: View mode, e.g. 'full', 'teaser'...
  54. * - $teaser: Flag for the teaser state (shortcut for $view_mode == 'teaser').
  55. * - $page: Flag for the full page state.
  56. * - $promote: Flag for front page promotion state.
  57. * - $sticky: Flags for sticky post setting.
  58. * - $status: Flag for published status.
  59. * - $comment: State of comment settings for the node.
  60. * - $readmore: Flags true if the teaser content of the node cannot hold the
  61. * main body content.
  62. * - $is_front: Flags true when presented in the front page.
  63. * - $logged_in: Flags true when the current user is a logged-in member.
  64. * - $is_admin: Flags true when the current user is an administrator.
  65. *
  66. * Field variables: for each field instance attached to the node a corresponding
  67. * variable is defined, e.g. $node->body becomes $body. When needing to access
  68. * a field's raw values, developers/themers are strongly encouraged to use these
  69. * variables. Otherwise they will have to explicitly specify the desired field
  70. * language, e.g. $node->body['en'], thus overriding any language negotiation
  71. * rule that was previously applied.
  72. *
  73. * @see template_preprocess()
  74. * @see template_preprocess_node()
  75. * @see template_process()
  76. */
  77. // echo "<pre>"; print_r($node); exit;
  78. ?>
  79. <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix<?php if ($display_submitted): ?> indent<?php endif; ?>" <?php print $attributes; ?>>
  80. <div class="item-content">
  81. <div class="title-and-meta">
  82. <?php print render($title_prefix); ?>
  83. <?php if ($page): ?>
  84. <h1 class="node-title" <?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h1>
  85. <?php endif; ?>
  86. <?php if (!$page): ?>
  87. <h2 class="node-title" <?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
  88. <?php endif; ?>
  89. <?php if ($display_submitted): ?>
  90. <div class="meta">
  91. <?php if ($display_submitted): ?>
  92. <span class="submitted">
  93. <?php print t('--By ') . $name; ?>
  94. </span>
  95. <?php endif; ?>
  96. </div>
  97. <?php endif; ?>
  98. <div class="item-picture">
  99. <?php
  100. $variables=array(
  101. 'path'=> $content['field_add_photos']['#object']->field_add_photos['und']['0']['uri'],
  102. 'width'=>'300px',
  103. 'height'=>'340px',
  104. );
  105. $item_pic=theme('image',$variables);
  106. //echo "<pre>"; print_r($item_pic); exit;
  107. print render($item_pic);
  108. ?>
  109. </div>
  110. <div class="item-user-details">
  111. <div class="item-owner-pic">
  112. <?php print $user_picture;?>
  113. </div>
  114. <div class="owner-icon-div">
  115. <img class="owner-icon" src=" <?php echo base_path(); ?>sites/default/files/dude2.jpg" />
  116. </div>
  117. <div class="item-owner-name">
  118. <?php print $name; ?>
  119. </div>
  120. <div class="phone-icon-div">
  121. <img class="owner-icon" src=" <?php echo base_path(); ?>sites/default/files/telephone1.jpg" />
  122. </div>
  123. <div class="item-owner-phone">
  124. <?php
  125. $user_uid=$content['field_add_price']['#object']->uid;
  126. //echo "<pre>"; print_r($user_uid); exit;
  127. $query = db_select('profile','p')
  128. ->fields('p',array('pid'))
  129. ->condition('p.uid',$user_uid,'=')
  130. ->execute();
  131. $query_obj_pid=$query->fetchObject();
  132. //echo "<pre>"; print_r($query_obj_pid->pid); exit;
  133. $query1=db_select('field_data_field_mobile','m')
  134. ->fields('m',array('field_mobile_value'))
  135. ->condition('m.entity_id',$query_obj_pid->pid,'=')
  136. ->execute();
  137. $query_obj_mobile=$query1->fetchObject();
  138. // echo "<pre>"; print_r($query_obj_mobile); exit;
  139. if($query_obj_mobile!=NULL)
  140. {
  141. print render($query_obj_mobile->field_mobile_value);
  142. }else
  143. {
  144. $custom_text="N/A";
  145. print render($custom_text);
  146. }
  147. ?>
  148. </div>
  149. <div class="other-ads-icon-div">
  150. <img class="owner-icon" src=" <?php echo base_path(); ?>sites/default/files/group.png" />
  151. </div>
  152. <div class="item-owner-other-ads">
  153. <?php
  154. //echo "<pre>"; print_r($content); exit;
  155. $user_uid=$content['field_add_price']['#object']->uid;
  156. //echo "<pre>"; print_r($user_uid); exit;
  157. $query = db_select('profile','p')
  158. ->fields('p',array('pid'))
  159. ->condition('p.uid',$user_uid,'=')
  160. ->execute();
  161. $query_obj_pid=$query->fetchObject();
  162. //echo "<pre>"; print_r($query_obj_pid->pid); exit;
  163. $query1=db_select('field_data_field_group','m')
  164. ->fields('m',array('field_group_value'))
  165. ->condition('m.entity_id',$query_obj_pid->pid,'=')
  166. ->execute();
  167. $query_obj_group=$query1->fetchObject();
  168. //echo "<pre>"; print_r($query_obj_mobile); exit;
  169. print render($query_obj_group->field_group_value);
  170. ?>
  171. </div>
  172. <div class="item-price">
  173. <?php //echo "<pre>"; print_r($content['field_add_price']['#object']); exit;
  174. if($content['field_add_price']['#object']->field_add_price['und']['0']['value']=='Enter Price')
  175. {
  176. $priced = 'Rs ' .$content['field_add_price']['#object']->field_add_price_text['und']['0']['value'];
  177. print render($priced);
  178. }else if($content['field_add_price']['#object']->field_add_price['und']['0']['value']=='Free')
  179. {
  180. $free="FREE";
  181. print render($free);
  182. }
  183. ?>
  184. </div>
  185. <div class="item-details">
  186. <?php
  187. //echo "<pre>"; print_r($content); exit;
  188. $item_catgy='<strong>Category: </strong>' .l($content['field_add_category']['#object']->field_add_category['und']['0']['taxonomy_term']->name,'taxonomy/term/'. $content['field_add_category']['#object']->field_add_category['und']['0']['taxonomy_term']->tid) . '<br/>';
  189. print render($item_catgy);
  190. $item_type='<strong>Type: </strong>' .$content['field_add_type']['#object']->field_add_type['und']['0']['value'] . '<br/>';
  191. print render($item_type);
  192. $item_posted='<strong>Posted On: </strong>'. date("M d,Y",$content['field_add_category']['#object']->created). '<br/>';
  193. print render($item_posted);
  194. ?>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. <div class="item-description">
  200. <h5 class="description">Description</h5>
  201. <div class="main-description">
  202. <?php //echo "<pre>";print_r($content ['field_add_description']['#object']->field_add_description['und']['0']['value']); exit;
  203. $item_description=$content ['field_add_description']['#object']->field_add_description['und']['0']['value'];
  204. print $item_description;
  205. ?>
  206. </div>
  207. </div>
  208. <div class="links-wrapper">
  209. <?php print render($content['links']); ?>
  210. </div>
  211. <?php /*echo "<pre>"; print_r($content['comments']); exit;*/print render($content['comments']); ?>
  212. </div>