PageRenderTime 24ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/bb-templates/WPMimic/profile.php

https://bitbucket.org/iRonBot/bbpress-persian
PHP | 89 lines | 87 code | 2 blank | 0 comment | 20 complexity | 5bff8a8f2f46efed49971235ad69f445 MD5 | raw file
  1. <?php bb_get_header(); ?>
  2. <div class="bbcrumb"><a href="<?php bb_option('uri'); ?>">انجمن</a> » شناسنامهی <?php echo get_user_name( $user->ID ); ?></div>
  3. <div id="sidebar"><!-- Sidebar -->
  4. <ul>
  5. <li style="border: none; padding: 25px; background: #eee; border: 1px solid #ddd;"><?php echo bb_get_avatar( $user->ID,$size='250'); ?></li>
  6. <?php
  7. global $bb_table_prefix;
  8. $query1 = "SELECT COUNT(*) FROM ".$bb_table_prefix."posts WHERE poster_id = $user_id AND post_status = 0";
  9. $query2 = "SELECT COUNT(*) FROM ".$bb_table_prefix."posts WHERE poster_id = $user_id AND post_status = 0 AND post_position = 1";
  10. echo "<li>تعداد نوشته‌ها: ".$bbdb->get_var($query1)."</li>";
  11. echo "<li>تعداد موضوع‌های آغازشده: ".$bbdb->get_var($query2)."</li>"; ?>
  12. </ul>
  13. <?php if (bb_profile_data() ); ?>
  14. <?php if (is_bb_profile()) profile_menu(); ?>
  15. <br></div><!-- /sidebar -->
  16. <div id="ajax">
  17. <div id="ajaxInner">
  18. <div id="content"><!-- Content -->
  19. <table>
  20. <thead>
  21. <tr>
  22. <th class="title">آخرین پاسخها</th>
  23. <th><?php if ( $user->ID == bb_get_current_user_info( 'id' ) ) printf('آخرین پاسخ شما'); else printf('آخرین پاسخ کاربر'); ?></th>
  24. <th>آخرین پاسخ</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <?php if ( $posts ) : ?>
  29. <?php foreach ($posts as $bb_post) : $topic = get_topic( $bb_post->topic_id ) ?>
  30. <tr<?php alt_class('replies'); ?>>
  31. <td class="title"><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
  32. <td><?php if ( $user->ID == bb_get_current_user_info( 'id' ) ) printf(__('%s پیش'), bb_get_post_time()); else printf(__('%s پیش'), bb_get_post_time()); ?></td>
  33. <td><?php if ( bb_get_post_time( 'timestamp' ) < get_topic_time( 'timestamp' ) ) printf(__('%s پیش'), get_topic_time()); else _e('بدون پاسخ');?></td>
  34. </tr>
  35. <?php endforeach; ?>
  36. <?php else : if ( $page ) : ?>
  37. <tr>
  38. <td class="title">پاسخهای بیشتری داده نشده.</td>
  39. <td></td>
  40. <td></td>
  41. </tr>
  42. <?php else : ?>
  43. <tr>
  44. <td class="title">بدون پاسخ تا بهحال</td>
  45. <td></td>
  46. <td></td>
  47. </tr>
  48. <?php endif; endif; ?>
  49. </tbody>
  50. </table>
  51. <table>
  52. <thead>
  53. <tr>
  54. <th class="title">موضوعهای آغازشده</th>
  55. <th>آعازشده</th>
  56. <th>آخرین پاسخ</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <?php if ( $topics ) : ?>
  61. <?php foreach ($topics as $topic) : ?>
  62. <tr<?php alt_class('topics'); ?>>
  63. <td class="title"><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
  64. <td><?php printf(__('%s پیش'), get_topic_start_time()); ?></td>
  65. <td><?php if ( get_topic_start_time( 'timestamp' ) < get_topic_time( 'timestamp' ) ) printf(__('%s پیش'), get_topic_time()); else _e('بدون پاسخ'); ?></td>
  66. </tr>
  67. <?php endforeach; ?>
  68. <?php else : if ( $page ) : ?>
  69. <tr>
  70. <td class="title">موضوعهای بیشتری آغاز نشده.</td>
  71. <td></td>
  72. <td></td>
  73. </tr>
  74. <?php else : ?>
  75. <tr>
  76. <td class="title">.هیچ موضوعی تا بهحال آغاز نشده</td>
  77. <td></td>
  78. <td></td>
  79. </tr>
  80. <?php endif; endif; ?>
  81. </tbody>
  82. </table>
  83. </div><!-- /content -->
  84. <div id="postPagination"><div class="nav"><?php profile_pages(); ?></div></div>
  85. </div>
  86. </div>
  87. <?php bb_get_footer(); ?>