Advertisement
Guest User

Untitled

a guest
Jul 11th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. /** creates slug for SEO friendly URLs.
  15. * @param string
  16. *
  17. */
  18. function slug($str) {
  19. global $config;
  20.  
  21. $str = trToEn( trim( $str ) );
  22. $str = preg_replace( '/[^0-9a-z]/u', ' ', strtolower( $str ) );
  23. $str = preg_replace( '#\s{1,}#u', ' ', $str );
  24.  
  25. if ($config['noStopwords'] == 1) {
  26. $str = removeStopwords( ' ' . $str . ' ' );
  27. }
  28.  
  29. return trim( str_replace( ' ', $config['delimiter'], $str ) );
  30. }
  31.  
  32. /** bring recent comments
  33. * @param int
  34. */
  35. function recentComments($int = 5) {
  36. $query = mysql_query( . 'SELECT * FROM comments WHERE isApproved=\'1\' ORDER BY id DESC LIMIT ' . $int );
  37. $comments = array( );
  38. $i = 297;
  39.  
  40. if ($row = mysql_fetch_assoc( $query )) {
  41. $comments[$i] = $row;
  42.  
  43. if ($row['commentType'] == 1) {
  44. $comments[$i]['type'] = 'video';
  45. $q = mysql_query( 'SELECT slug,title FROM videos WHERE id=' . $row['contentID'] . ' LIMIT 1' );
  46. $r = mysql_fetch_assoc( $q );
  47. $comments[$i]['title'] = $r['title'];
  48. $comments[$i]['slug'] = videoURL( $row['contentID'], $r['slug'] );
  49. } else {
  50. if ($row['commentType'] == 2) {
  51. $comments[$i]['type'] = 'category';
  52. $q = mysql_query( 'SELECT slug,name FROM categories WHERE id=' . $row['contentID'] . ' LIMIT 1' );
  53. $r = mysql_fetch_assoc( $q );
  54. $comments[$i]['title'] = $r['name'];
  55. $comments[$i]['slug'] = catURL( $row['contentID'], $r['slug'] );
  56. } else {
  57. if ($row['commentType'] == 3) {
  58. $comments[$i]['type'] = 'tag';
  59. $q = mysql_query( 'SELECT slug,name FROM tags WHERE id=' . $row['contentID'] . ' LIMIT 1' );
  60. $r = mysql_fetch_assoc( $q );
  61. $comments[$i]['title'] = $r['name'];
  62. $comments[$i]['slug'] = videoURL( $row['contentID'], $r['slug'] );
  63. } else {
  64. if ($row['commentType'] == 4) {
  65. }
  66. }
  67. }
  68. }
  69.  
  70. ++$i;
  71. }
  72.  
  73. return $comments;
  74. }
  75. ........................................
  76. .................
  77. .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement