Просмотр файла includes/functions_guestbook.php

Размер файла: 35.35Kb
  1. <?php
  2. ***************************************************************************/
  3.  
  4. if (!defined('IN_PHPBB'))
  5. {
  6. die("Hacking attempt");
  7. }
  8.  
  9. class guestbook{
  10. var $userdata;
  11. var $uid;
  12. var $url;
  13. var $url_intern;
  14. function guestbook(&$uid,$mode = false, $url = false)
  15. {
  16. global $phpEx;
  17. if(is_array($uid))
  18. {
  19. $this->userdata = $uid;
  20. }
  21. else
  22. {
  23. $this->userdata = get_userdata($uid);
  24. }
  25. $this->uid = $this->userdata['user_id'];
  26. $this->version = '1.0.8';
  27.  
  28. /**
  29. * Main url used at the guestbook.
  30. * If you want to add your guestbook to another place, change this url,
  31. * or give a url with parameter 3 when creating the class.
  32. * It must be a page on the server, and you must not include
  33. * http://site.url.ext/forum/, only profile.php.
  34. * There must be also a ? in the url.
  35. * At the end a &amp; isn't needed
  36. * VB: viewtopic.php?t=1.
  37. **/
  38.  
  39. if($url !== false)
  40. {
  41. $tmp = explode("?", $url);
  42. if(!count($tmp))
  43. {
  44. //No valid url, missing ?.
  45. $url = false;
  46. }
  47. else
  48. {
  49. if(!file_exists($tmp[0]))
  50. {
  51. //File doesn't exists
  52. $url = false;
  53. }
  54. }
  55. }
  56.  
  57. if($url === false )
  58. {
  59. $this->url_intern = "profile." . $phpEx . "?mode=wall&amp;" . POST_USERS_URL . "=" . $this->uid;
  60. }
  61. else
  62. {
  63. $this->url_intern = $url;
  64. }
  65.  
  66. if(!$mode)
  67. {
  68. return true;
  69. }
  70. else
  71. {
  72. return $this->mode($mode);
  73. }
  74. }
  75. function mode($mode)
  76. {
  77. global $userdata,$board_config,$lang;
  78. global $HTTP_GET_VARS, $template, $HTTP_POST_VARS, $phpbb_root_path, $phpEx, $db;
  79. if(!$this->userdata['user_can_gb'] || !$userdata['user_can_gb'] || (!$board_config['allow_guests_gb'] && !$userdata['session_logged_in']))
  80. {
  81. return false;
  82. }
  83. else
  84. {
  85. if ( isset($HTTP_POST_VARS['cancel']) )
  86. {
  87. $redirect = "profile.php?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $this->uid;
  88. redirect(append_sid($redirect, true));
  89. }
  90. $confirm = ( $HTTP_POST_VARS['confirm'] ) ? TRUE : 0;
  91. if(($mode == 'delete' || $mode == 'deleteall') && !$confirm)
  92. {
  93. $hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="gb_id" value="' . intval($HTTP_GET_VARS['gb_id']) . '" />';
  94.  
  95. //
  96. // Set template files
  97. //
  98. $template->set_filenames(array(
  99. 'confirm' => 'confirm_body.tpl')
  100. );
  101.  
  102. $template->assign_vars(array(
  103. 'MESSAGE_TITLE' => $lang['Confirm'],
  104. 'MESSAGE_TEXT' => $lang['Confirm_delete_gbpost'],
  105.  
  106. 'L_YES' => $lang['Yes'],
  107. 'L_NO' => $lang['No'],
  108.  
  109. 'S_CONFIRM_ACTION' => $this->append_sid("gb=" . $mode),
  110. 'S_HIDDEN_FIELDS' => $hidden_fields)
  111. );
  112.  
  113. $template->pparse('confirm');
  114.  
  115. include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
  116. }
  117. switch($mode){
  118. case "view":
  119. $this->view();
  120. break;
  121. case "quote":
  122. case "post":
  123. case "edit":
  124. $this->post($mode);
  125. break;
  126. case "delete":
  127. if($userdata['user_level'] == ADMIN || $userdata['user_id'] == $this->uid)
  128. {
  129. $this->delete();
  130. }
  131. else
  132. {
  133. message_die(GENERAL_MESSAGE,sprintf($lang['gb_no_per'],$lang['delete_pro']));
  134. }
  135. break;
  136. case "deleteall":
  137. if($userdata['user_level'] == ADMIN || $userdata['user_id'] == $this->uid)
  138. {
  139. $this->deleteall();
  140. }
  141. else
  142. {
  143. message_die(GENERAL_MESSAGE,sprintf($lang['gb_no_per'],$lang['delete_all_pro']));
  144. }
  145. break;
  146. default:
  147. return false;
  148. }
  149. }
  150. return true;
  151. }
  152. function view()
  153. {
  154. global $db,$HTTP_GET_VARS;
  155. $start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : 0;
  156. $start = ($start < 0) ? 0 : $start;
  157. $sql = "SELECT * FROM ".PROFILE_GUESTBOOK_TABLE." g, ".USERS_TABLE." u WHERE
  158. g.user_id = ".$this->uid." AND g.poster_id = u.user_id
  159. ORDER BY g.gb_time DESC
  160. LIMIT $start, 10";
  161. if( !$result = $db->sql_query($sql) )
  162. {
  163. message_die(GENERAL_ERROR,"Could not query guestbook","",__LINE__,__FILE__,$sql);
  164. }
  165. if( !$db->sql_numrows($result) )
  166. {
  167. if($start == 0)
  168. {
  169. $this->maak_view($result,'nores',0);
  170. }
  171. else
  172. {
  173. $this->maak_view($result,'nopag',0);
  174. }
  175. }
  176. else
  177. {
  178. $this->maak_view($result,'',0);
  179. }
  180. }
  181. function maak_view($result,$fout = '',$tot)
  182. {
  183. global $phpbb_root_path,$phpEx,$template,$lang,$profiledata,$userdata,$images,$board_config;
  184. global $db,$theme,$HTTP_GET_VARS;
  185. include_once($phpbb_root_path."/includes/bbcode.".$phpEx);
  186. $template->set_filenames(array(
  187. 'gb_body' => 'gb_view.tpl')
  188. );
  189. $txt = sprintf($lang['gb_text'],$profiledata['username']);
  190. if($userdata['user_level'] == ADMIN)
  191. {
  192. $txt .= sprintf($lang['gb_text2'],$this->append_sid("gb=deleteall"));
  193. $txt .= "<br />".$this->version_check();
  194. }
  195. elseif($userdata['user_id'] == $this->uid || $userdata['user_level'] == MOD)
  196. {
  197. $txt .= sprintf($lang['gb_text2'],$this->append_sid("gb=deleteall"));
  198. }
  199. $template->assign_vars(array(
  200. "L_GUESTBOOK" => $lang['gb_txt'],
  201. "L_TXT" => $txt,
  202. "L_DIS" => $lang['dis'],
  203. "L_EN" => $lang['en'],
  204. "L_BACK_TO_TOP" => $lang['Back_to_top'],
  205. "L_NUMBER_URL" => $lang['number_url'],
  206. "MINI_POST_IMG" => $images['icon_minipost'],
  207. "UID" => $this->uid,
  208. "U" => POST_USERS_URL,
  209. "URL" => $board_config['server_name'],
  210. "PAD" => $board_config['script_path'],
  211. "SECURE" => ($board_config['cookie_secure']) ? "s" : '',
  212. "PHPEX" => $phpEx,
  213. ));
  214. if($fout != '')
  215. {
  216. $reply_img = $images['reply_new'];
  217. $reply_alt = $lang['gb_reply'];
  218. $reply_topic_url = $this->append_sid('gb=post');
  219. $template->assign_vars(array(
  220. 'REPLY_IMG' => $reply_img,
  221. 'U_POST_REPLY_TOPIC' => $reply_topic_url)
  222. );
  223. switch($fout)
  224. {
  225. case "nores":
  226. $template->assign_block_vars("error",array(
  227. "L_GUESTBOOK_ERROR" => $lang['gb_error2'],
  228. "ERROR" => $lang['gb_nores']
  229. ));
  230. break;
  231. case "nopag":
  232. $template->assign_block_vars("error",array(
  233. "L_GUESTBOOK_ERROR" => $lang['gb_error'],
  234. "ERROR" => $lang['gb_nopag']
  235. ));
  236. break;
  237. }
  238. }
  239. else
  240. {
  241. $postrow = array();
  242. $postrow = $db->sql_fetchrowset($result);
  243. $total_posts = count($postrow);
  244. //Why global the var from usercp_wall, thats is one query less :P
  245.  
  246. global $ranksrow;
  247.  
  248. //
  249. // Define censored word matches
  250. //
  251. $orig_word = array();
  252. $replacement_word = array();
  253. obtain_word_list($orig_word, $replacement_word);
  254. $reply_img = $images['reply_new'];
  255. $reply_alt = $lang['gb_reply'];
  256. $reply_topic_url = $this->append_sid('gb=post');
  257. $sql2 = "SELECT * FROM " . PROFILE_GUESTBOOK_TABLE . " WHERE user_id = " . $this->uid;
  258. $result2 = $db->sql_query($sql2);
  259. if(!$result2)
  260. {
  261. message_die(GENERAL_ERROR,"Could not get total of guestbook posts!","",__LINE__,__FILE__,$sql2);
  262. }
  263. $total_replies = $db->sql_numrows($result2);
  264. $start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : 0;
  265. $pagination = generate_pagination('profile.'.$phpEx.'?mode=wall&gb=view&'.POST_USERS_URL.'='.$this->uid, $total_replies, 10, $start);
  266. $template->assign_block_vars('main',array(
  267. 'PAGINATION' => $pagination,
  268. 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / intval(10) ) + 1 ), ceil( $total_replies / intval(10) )),
  269.  
  270. 'REPLY_IMG' => $reply_img,
  271.  
  272. 'L_AUTHOR' => $lang['Author'],
  273. 'POSTER_STATUS' => $poster_status,
  274. 'L_MESSAGE' => $lang['Message'],
  275. 'L_POSTED' => $lang['Posted'],
  276. 'L_POST_SUBJECT' => $lang['gb_title'],
  277. 'L_POST_REPLY_TOPIC' => $reply_alt,
  278. 'L_GOTO_PAGE' => $lang['Goto_page'],
  279.  
  280. 'U_POST_REPLY_TOPIC' => $reply_topic_url)
  281. );
  282. $template->assign_vars(array(
  283. 'PAGINATION' => $pagination,
  284. 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / intval(10) ) + 1 ), ceil( $total_replies / intval(10) )),
  285. 'REPLY_IMG' => $reply_img,
  286.  
  287. 'U_POST_REPLY_TOPIC' => $reply_topic_url)
  288. );
  289.  
  290.  
  291. $post_nr = 0;
  292. if($start != 0) {
  293. $post_nr += (int)$start;
  294. }
  295. for($i = 0; $i < $total_posts; $i++)
  296. {
  297. $post_nr++;
  298.  
  299. $poster_id = $postrow[$i]['poster_id'];
  300. $poster = ( $poster_id == ANONYMOUS ) ? (!empty($postrow[$i]['user_guest_name'])) ? $postrow[$i]['user_guest_name']."(".$lang['Guest'].")": $lang['Guest'] : $postrow[$i]['username'];
  301.  
  302. $post_date = create_date($board_config['default_dateformat'], $postrow[$i]['gb_time'], $board_config['board_timezone']);
  303.  
  304. $poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . '[' . $postrow[$i]['user_posts'].']' : '';
  305.  
  306. $poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';
  307.  
  308. //
  309. // Generate ranks, set them to empty string initially.
  310. //
  311. $poster = ( $poster_id == ANONYMOUS ) ? ( ($postrow[$i]['post_username'] != '' ) ? $postrow[$i]['post_username'] : $lang['Guest'] ) : '<a href="' . append_sid("profile.$phpEx?mode=wall&amp;" . POST_USERS_URL . '=' . $postrow[$i]['user_id']) . '" style="color:#000000">' . $postrow[$i]['username'] . '</a>';
  312.  
  313. if ( $postrow[$i]['user_level'] == ADMIN )
  314. {
  315. $poster_status = ' Адм ';
  316. } elseif ( $postrow[$i]['user_level'] == MOD ) {
  317. $poster_status = ' Мод ';
  318. } else {
  319. $poster_status = '';
  320. }
  321.  
  322. //
  323. // Handle anon users posting with usernames
  324. //
  325. if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
  326. {
  327. $poster = $postrow[$i]['post_username'];
  328. $poster_rank = $lang['Guest'];
  329. }
  330.  
  331. $temp_url = '';
  332.  
  333. if ( $poster_id != ANONYMOUS )
  334. {
  335. $temp_url = append_sid("profile.$phpEx?mode=wall&amp;" . POST_USERS_URL . "=$poster_id");
  336. $poster = '<a href="' . $temp_url . '">'.$poster.'</a>';
  337.  
  338. $temp_url = append_sid("privmsg.$phpEx?mode=post&amp;" . POST_USERS_URL . "=$poster_id");
  339. $pm_img = '<a href="' . $temp_url . '">ЛС</a>|';
  340.  
  341. if ( !empty($postrow[$i]['user_viewemail']) || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )
  342. {
  343. $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL .'=' . $poster_id) : 'mailto:' . $postrow[$i]['user_email'];
  344.  
  345. $email_img = '<a href="' . $email_uri . '">Email</a>';
  346. }
  347. else
  348. {
  349. $email_img = '';
  350. $email = '';
  351. }
  352.  
  353. $www_img = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
  354. $www = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
  355.  
  356. if ( !empty($postrow[$i]['user_icq']) )
  357. {
  358. $icq_status_img = '<a href="http://wwp.icq.com/' . $postrow[$i]['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $postrow[$i]['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
  359. $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $postrow[$i]['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
  360. $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $postrow[$i]['user_icq'] . '">' . $lang['ICQ'] . '</a>';
  361. }
  362. else
  363. {
  364. $icq_status_img = '';
  365. $icq_img = '';
  366. $icq = '';
  367. }
  368. }
  369. else
  370. {
  371. $profile_img = '';
  372. $profile = '';
  373. $pm_img = '';
  374. $pm = '';
  375. $email_img = '';
  376. $email = '';
  377. $www_img = '';
  378. $www = '';
  379. $icq_status_img = '';
  380. $icq_img = '';
  381. $icq = '';
  382. $aim_img = '';
  383. $aim = '';
  384. $msn_img = '';
  385. $msn = '';
  386. $yim_img = '';
  387. $yim = '';
  388. }
  389.  
  390. $temp_url = $this->append_sid("gb=quote&amp;gb_id=" . $postrow[$i]['gb_id']);
  391. $quote_img = '<a href="' . $temp_url . '">Цит</a>|';
  392.  
  393. $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($postrow[$i]['username']) . "&amp;showresults=posts");
  394. $search_img = '<a href="' . $temp_url . '">Поиск</a>';
  395.  
  396. if (($poster_id != ANONYMOUS && $userdata['user_id'] == $poster_id) || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $userdata['user_id'] == $this->uid)
  397. {
  398. $temp_url = $this->append_sid("gb=edit&amp;gb_id=".$postrow[$i]['gb_id']);
  399. $edit_img = '<a href="' . $temp_url . '">Изм</a>|';
  400. }
  401. else
  402. {
  403. $edit_img = '';
  404. $edit = '';
  405. }
  406.  
  407. if ( $userdata['user_id'] == $postrow['poster_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $userdata['user_id'] == $this->uid)
  408. {
  409. $temp_url = $this->append_sid("gb=delete&amp;gb_id=" . $postrow[$i]['gb_id']);
  410. $delpost_img = '<a href="' . $temp_url . '">Уд</a>';
  411. $delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
  412. }
  413. else
  414. {
  415. $delpost_img = '';
  416. $delpost = '';
  417. }
  418.  
  419. $post_title = ( $postrow[$i]['title'] != '' ) ? $postrow[$i]['title'] : '';
  420.  
  421. $message = stripslashes($postrow[$i]['message']);
  422. $bbcode_uid = $postrow[$i]['bbcode'];
  423.  
  424. $user_sig = ( $postrow[$i]['enable_sig'] && $postrow[$i]['user_sig'] != '' && $board_config['allow_sig'] ) ? $postrow[$i]['user_sig'] : '';
  425. $user_sig_bbcode_uid = $postrow[$i]['user_sig_bbcode_uid'];
  426.  
  427. //
  428. // Note! The order used for parsing the message _is_ important, moving things around could break any
  429. // output
  430. //
  431.  
  432.  
  433. //
  434. // Parse message and/or sig for BBCode if reqd
  435. //
  436. if ( $user_sig != '' && $user_sig_bbcode_uid != '' )
  437. {
  438. $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
  439. }
  440.  
  441. if ( $bbcode_uid != '' )
  442. {
  443. $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
  444. $post_title = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($post_title, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $post_title);
  445. }
  446.  
  447. if ( $user_sig != '' )
  448. {
  449. $user_sig = make_clickable($user_sig);
  450. }
  451. $message = make_clickable($message);
  452.  
  453. //
  454. // Parse smilies
  455. //
  456. if ( $postrow[$i]['user_allowsmile'] && $user_sig != '' )
  457. {
  458. $user_sig = smilies_pass($user_sig);
  459. }
  460. $message = smilies_pass($message);
  461. $post_title = smilies_pass($post_title);
  462.  
  463.  
  464. //
  465. // Replace naughty words
  466. //
  467. if (count($orig_word))
  468. {
  469. $post_title = preg_replace($orig_word, $replacement_word, $post_title);
  470.  
  471. if ($user_sig != '')
  472. {
  473. $user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
  474. }
  475.  
  476. $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
  477. }
  478.  
  479. //
  480. // Replace newlines (we use this rather than nl2br because
  481. // till recently it wasn't XHTML compliant)
  482. //
  483. if ( $user_sig != '' )
  484. {
  485. $user_sig = '<br />_________________<br />' . str_replace("\n", "\n<br />\n", $user_sig);
  486. }
  487.  
  488. $message = str_replace("\n", "\n<br />\n", $message);
  489.  
  490.  
  491. //
  492. // Again this will be handled by the templating
  493. // code at some point
  494. //
  495. $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
  496. $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
  497. $template->assign_block_vars('main.postrow', array(
  498. 'U_POST_ID' => $postrow[$i]['gb_id'],
  499. 'ROW_COLOR' => '#' . $row_color,
  500. 'ROW_CLASS' => $row_class,
  501. 'POSTER_NAME' => $poster,
  502. 'POSTER_RANK' => $poster_rank,
  503. 'RANK_IMAGE' => $rank_image,
  504. 'POSTER_JOINED' => $poster_joined,
  505. 'POSTER_POSTS' => $poster_posts,
  506. 'POSTER_STATUS' => $poster_status,
  507. 'POSTER_FROM' => $poster_from,
  508. 'POSTER_AVATAR' => $poster_avatar,
  509. 'POST_DATE' => $post_date,
  510. 'POST_SUBJECT' => $post_title,
  511. 'MESSAGE' => $message,
  512. 'SIGNATURE' => $user_sig,
  513.  
  514. 'PROFILE_IMG' => $profile_img,
  515. 'PROFILE' => $profile,
  516. 'SEARCH_IMG' => $search_img,
  517. 'SEARCH' => $search,
  518. 'PM_IMG' => $pm_img,
  519. 'PM' => $pm,
  520. 'EMAIL_IMG' => $email_img,
  521. 'EMAIL' => $email,
  522. 'WWW_IMG' => $www_img,
  523. 'WWW' => $www,
  524. 'ICQ_STATUS_IMG' => $icq_status_img,
  525. 'ICQ_IMG' => $icq_img,
  526. 'ICQ' => $icq,
  527. 'AIM_IMG' => $aim_img,
  528. 'AIM' => $aim,
  529. 'MSN_IMG' => $msn_img,
  530. 'MSN' => $msn,
  531. 'YIM_IMG' => $yim_img,
  532. 'YIM' => $yim,
  533. 'EDIT_IMG' => $edit_img,
  534. 'EDIT' => $edit,
  535. 'QUOTE_IMG' => $quote_img,
  536. 'QUOTE' => $quote,
  537. 'DELETE_IMG' => $delpost_img,
  538. 'DELETE' => $delpost,
  539. 'NUMBER' => $post_nr
  540. ));
  541. }
  542. }
  543. include_once($phpbb_root_path."/includes/functions_post.".$phpEx);
  544. //Check if quick reply is enabled.
  545.  
  546. $quick_valid = true;
  547.  
  548. if($board_config['gb_posts'] > 0 && $userdata['user_posts'] <= $board_config['gb_posts'])
  549. {
  550. $quick_valid = false;
  551. }
  552.  
  553. if($board_config['gb_quick'] && $quick_valid)
  554. {
  555. $template->assign_block_vars('quick',array());
  556.  
  557. $inline_columns = 15;
  558. $inline_rows = 1;
  559.  
  560. $sql = "SELECT emoticon, code, smile_url
  561. FROM " . SMILIES_TABLE . "
  562. ORDER BY smilies_id";
  563. if ($result = $db->sql_query($sql))
  564. {
  565. $num_smilies = 0;
  566. $rowset = array();
  567. while ($row = $db->sql_fetchrow($result))
  568. {
  569. if (empty($rowset[$row['smile_url']]))
  570. {
  571. $rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code']));
  572. $rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
  573. $num_smilies++;
  574. }
  575. }
  576.  
  577. if ($num_smilies)
  578. {
  579. $smilies_split_row = $inline_columns - 1;
  580.  
  581. $s_colspan = 0;
  582. $row = 0;
  583. $col = 0;
  584.  
  585. while (list($smile_url, $data) = @each($rowset))
  586. {
  587. if (!$col)
  588. {
  589. $template->assign_block_vars('quick.smilies_row', array());
  590. }
  591.  
  592. $template->assign_block_vars('quick.smilies_row.smilies_col', array(
  593. 'SMILEY_CODE' => $data['code'],
  594. 'SMILEY_IMG' => $board_config['smilies_path'] . '/' . $smile_url,
  595. 'SMILEY_DESC' => $data['emoticon'])
  596. );
  597.  
  598. $s_colspan = max($s_colspan, $col + 1);
  599.  
  600. if ($col == $smilies_split_row)
  601. {
  602. if ($row == $inline_rows - 1)
  603. {
  604. break;
  605. }
  606. $col = 0;
  607. $row++;
  608. }
  609. else
  610. {
  611. $col++;
  612. }
  613. }
  614.  
  615. if ($num_smilies > $inline_rows * $inline_columns)
  616. {
  617. $template->assign_block_vars('quick.switch_smilies_extra', array());
  618.  
  619. $template->assign_vars(array(
  620. 'L_MORE_SMILIES' => $lang['More_emoticons'],
  621. 'U_MORE_SMILIES' => append_sid("posting.$phpEx?mode=smilies"))
  622. );
  623. }
  624.  
  625. $template->assign_vars(array(
  626. 'L_EMOTICONS' => $lang['Emoticons'],
  627. 'L_CLOSE_WINDOW' => $lang['Close_window'],
  628. 'S_SMILIES_COLSPAN' => $s_colspan)
  629. );
  630. }
  631. }
  632. }
  633.  
  634. if(!$userdata['session_logged_in'])
  635. {
  636. $template->assign_block_vars('quick.username',array());
  637. }
  638. $action = $this->append_sid("gb=post");
  639. $template->assign_vars(array(
  640. 'L_POST_QUICK' => $lang['gb_quick_reply'],
  641. 'L_GB_POST' => $lang['gb_post2'],
  642. 'L_TITLE' => $lang['gb_title'],
  643. 'L_MESSAGE_BODY' => $lang['Message_body'],
  644. 'L_SUBMIT' => $lang['Submit'],
  645. 'L_USERNAME' => $lang['Username'],
  646.  
  647. 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
  648. 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
  649. 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
  650. 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
  651. 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
  652. 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
  653. 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
  654. 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
  655. 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
  656. 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
  657. 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
  658. 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
  659. 'L_EMPTY_MESSAGE' => $lang['Empty_message'],
  660.  
  661. 'L_FONT_COLOR' => $lang['Font_color'],
  662. 'L_COLOR_DEFAULT' => $lang['color_default'],
  663. 'L_COLOR_DARK_RED' => $lang['color_dark_red'],
  664. 'L_COLOR_RED' => $lang['color_red'],
  665. 'L_COLOR_ORANGE' => $lang['color_orange'],
  666. 'L_COLOR_BROWN' => $lang['color_brown'],
  667. 'L_COLOR_YELLOW' => $lang['color_yellow'],
  668. 'L_COLOR_GREEN' => $lang['color_green'],
  669. 'L_COLOR_OLIVE' => $lang['color_olive'],
  670. 'L_COLOR_CYAN' => $lang['color_cyan'],
  671. 'L_COLOR_BLUE' => $lang['color_blue'],
  672. 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
  673. 'L_COLOR_INDIGO' => $lang['color_indigo'],
  674. 'L_COLOR_VIOLET' => $lang['color_violet'],
  675. 'L_COLOR_WHITE' => $lang['color_white'],
  676. 'L_COLOR_BLACK' => $lang['color_black'],
  677.  
  678. 'L_FONT_SIZE' => $lang['Font_size'],
  679. 'L_FONT_TINY' => $lang['font_tiny'],
  680. 'L_FONT_SMALL' => $lang['font_small'],
  681. 'L_FONT_NORMAL' => $lang['font_normal'],
  682. 'L_FONT_LARGE' => $lang['font_large'],
  683. 'L_FONT_HUGE' => $lang['font_huge'],
  684.  
  685. 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
  686. 'L_STYLES_TIP' => $lang['Styles_tip'],
  687.  
  688. 'U_PROFILE' => append_sid('profile.'.$phpEx.'?mode=wall&amp;'.POST_USERS_URL.'='.$this->uid),
  689.  
  690. 'S_POST_ACTION' => $action
  691. )
  692. );
  693. $template->assign_var_from_handle('GUESTBOOK', 'gb_body');
  694. }
  695. function post($mode)
  696. {
  697. global $board_config,$userdata,$lang,$HTTP_POST_VARS,$phpbb_root_path,$phpEx,$db,$HTTP_GET_VARS,$unhtml_specialchars_replace,$unhtml_specialchars_match,$html_entities_match,$html_entities_replace;
  698. if($board_config['allow_guests_gb'] == 0 && !$userdata['session_logged_in'])
  699. {
  700. message_die(GENERAL_MESSAGE,sprintf($lang['gb_no_per'],$lang['post_pro']));
  701. }
  702. elseif($board_config['gb_posts'] > 0 && $userdata['user_posts'] <= $board_config['gb_posts'] && $userdata['user_id'] != ANONYMOUS)
  703. {
  704. message_die(GENERAL_MESSAGE,sprintf($lang['gb_posts_not'],$board_config['gb_posts']));
  705. }
  706. if(isset($HTTP_POST_VARS['message']))
  707. {
  708. $me = $HTTP_POST_VARS['message'];
  709. $ti = $HTTP_POST_VARS['subject'];
  710. //This code stands always after the error trigger.
  711. include_once($phpbb_root_path."/includes/bbcode.".$phpEx);
  712. include_once($phpbb_root_path."/includes/functions_post.".$phpEx);
  713.  
  714. $bbcode = make_bbcode_uid();
  715. $me = prepare_message($me,$board_config['allow_html'],true,true,$bbcode);
  716. $ti = prepare_message($ti,false,true,true,$bbcode);//No HTML in titles. BBcode and smilies are allowed.
  717. $err = false;
  718. $errmsg = array();
  719. if(empty($me))
  720. {
  721. $errmsg[] = $lang['gb_no_me'];
  722. $err = true;
  723. }
  724. //In version 0.0.3 title can be empty!
  725.  
  726.  
  727. //Guest username, added in version 0.0.4
  728. if(!$userdata['session_logged_in'])
  729. {
  730. if(!empty($HTTP_POST_VARS['username']))
  731. {
  732. $username = phpbb_clean_username($HTTP_POST_VARS['username']);
  733. }
  734. else
  735. {
  736. $username = '';
  737. }
  738. }
  739. else
  740. {
  741. $username = '';
  742. }
  743. if($err)
  744. {
  745. $id = intval($HTTP_GET_VARS['gb_id']);
  746.  
  747. $action = $this->append_sid("gb=$mode&amp;id=$id");
  748. $this->post_table($me,$ti,$action,$username,$errmsg);
  749. return;
  750. }
  751.  
  752. $pid = $userdata['user_id'];
  753. if($mode != 'edit')
  754. {
  755.  
  756. //In version 0.0.4, one new field!
  757. $sql = "INSERT INTO ".PROFILE_GUESTBOOK_TABLE." (user_id,poster_id,bbcode,title,message,gb_time,user_guest_name) VALUES
  758. (".$this->uid.",$pid,'$bbcode','$ti','$me','".time()."','$username');";
  759. }
  760. else
  761. {
  762. $id = intval($HTTP_GET_VARS['gb_id']);
  763. if(empty($id))
  764. {
  765. message_die(GENERAL_ERROR,$lang['gb_no_id'],"",__LINE__,__FILE__);
  766. }
  767. $sql = "UPDATE ".PROFILE_GUESTBOOK_TABLE." SET
  768. bbcode = '$bbcode', title = '$ti', message = '$me' WHERE gb_id = $id";
  769. }
  770. $result = $db->sql_query($sql);
  771. if(!$result)
  772. {
  773. message_die(GENERAL_ERROR,"Could not insert or update user guestbook!","",__LINE__,__FILE__,$sql);
  774. }
  775.  
  776. $id = $db->sql_nextid();
  777. $msg = '<br /><a href="' . $this->append_sid("gb=view") . '#' . $id . '">'.$lang['back_pro'] . '</a>';
  778.  
  779. if($mode == 'edit')
  780. {
  781. message_die(GENERAL_MESSAGE,$lang['gb_edit'].$msg);
  782. }
  783. else
  784. {
  785. $this->email($id);
  786. message_die(GENERAL_MESSAGE,$lang['gb_post'].$msg);
  787. }
  788. }
  789. else
  790. {
  791. if($mode == 'edit')
  792. {
  793. $id = intval($HTTP_GET_VARS['gb_id']);
  794. if(empty($id))
  795. {
  796. message_die(GENERAL_ERROR,$lang['gb_no_id'],"",__LINE__,__FILE__);
  797. }
  798. $action = $this->append_sid("gb=edit&amp;gb_id=" . $id);
  799. $sql = "SELECT * FROM ".PROFILE_GUESTBOOK_TABLE." WHERE gb_id = $id";;
  800. $r = $db->sql_query($sql);
  801. if(!$r)
  802. {
  803. message_die(GENERAL_ERROR,"Could not select edit information!",__LINE__,__FILE__,$sql);
  804. }
  805. $row = $db->sql_fetchrow($r);
  806. if($userdata['user_level'] != ADMIN && $userdata['user_level'] != MOD && $userdata['user_id'] != $this->uid && $row['poster_id'] != $userdata['user_id'])
  807. {
  808. message_die(GENERAL_MESSAGE,sprintf($lang['gb_no_per'],$lang['edit_pro']));
  809. }
  810. $me = str_replace(':'.$row['bbcode'],'',$row['message']);
  811. $ti = str_replace(':'.$row['bbcode'],'',$row['title']);
  812.  
  813. }
  814. elseif($mode == 'quote')
  815. {
  816. $action = $this->append_sid("gb=post");
  817. $id = intval($HTTP_GET_VARS['gb_id']);
  818. if(empty($id)){
  819. message_die(GENERAL_ERROR,$lang['gb_no_id'],"",__LINE__,__FILE__);
  820. }
  821. $sql = "SELECT * FROM ".PROFILE_GUESTBOOK_TABLE." g, ".USERS_TABLE." u WHERE g.gb_id = $id AND u.user_id = g.poster_id";
  822. $result = $db->sql_query($sql);
  823. if(!$result)
  824. {
  825. message_die(GENERAL_ERROR,"Could not select edit information!",__LINE__,__FILE__,$sql);
  826. }
  827. $row = $db->sql_fetchrow($result);
  828. $me = str_replace(':'.$row['bbcode'],'',$row['message']);
  829. $ti = str_replace(':'.$row['bbcode'],'',$row['title']);
  830. if($row['user_id'] != ANONYMOUS)
  831. {
  832. $me = '[quote="' . $row['username'] . '"]' . $me . '[/quote]';
  833. }
  834. else
  835. {
  836. if(!empty($row['user_guest_name']))
  837. {
  838. $me = '[quote="' . $row['user_guest_name'] . '"]' . $me . '[/quote]';
  839. }
  840. else
  841. {
  842. $me = '[quote]' . $me . '[/quote]';
  843. }
  844. }
  845. $ti = $lang['re'] . ":".$ti;
  846. }
  847. else
  848. {
  849. $action = $this->append_sid("gb=post");
  850. $me = '';
  851. $ti = '';
  852. }
  853. $this->post_table($me,$ti,$action);
  854. return;
  855. }
  856. }
  857.  
  858. function email($post_id)
  859. {
  860. global $db,$board_config,$phpbb_root_path,$phpEx,$lang;
  861.  
  862. if($this->userdata['user_email_new_gb'] == 0)
  863. {
  864. return;
  865. }
  866. $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
  867. $script_name = ( $script_name != '' ) ? $script_name . '/profile.'.$phpEx : 'profile.'.$phpEx;
  868. $server_name = trim($board_config['server_name']);
  869. $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
  870. $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
  871. include_once($phpbb_root_path . 'includes/emailer.'.$phpEx);
  872. $emailer = new emailer($board_config['smtp_delivery']);
  873.  
  874. $emailer->from($board_config['board_email']);
  875. $emailer->replyto($board_config['board_email']);
  876.  
  877. $emailer->use_template('guestbook', $this->userdata['user_lang']);
  878. $emailer->email_address($this->userdata['user_email']);
  879. $emailer->set_subject($lang['gb_email']);
  880.  
  881. $emailer->assign_vars(array(
  882. "U_ACT" => $server_protocol . $server_name . $server_port . $script_name."?mode=wall&".POST_USERS_URL."=".$this->userdata['user_id'] . "#" . $post_id,
  883. "USERNAME" => $this->userdata['username'],
  884. 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
  885. ));
  886. $emailer->send();
  887. $emailer->reset();
  888. return;
  889. }
  890. function post_table($me,$ti,$action,$username = '',$errmsg = array())
  891. {
  892. global $phpbb_root_path,$phpEx,$template,$mode,$userdata,$lang,$db,$unhtml_specialchars_replace,$unhtml_specialchars_match,$html_entities_match,$html_entities_replace;
  893.  
  894.  
  895. include_once($phpbb_root_path."/includes/bbcode.".$phpEx);
  896. include_once($phpbb_root_path."/includes/functions_post.".$phpEx);
  897. $template->set_filenames(array(
  898. 'body' => 'gb_post.tpl')
  899. );
  900. if(count($errmsg) > 0)
  901. {
  902. $template->set_filenames(array(
  903. 'reg_header' => 'error_body.tpl')
  904. );
  905. $error_msg = $lang['gb_error'];
  906. for($i = 0;$i<count($errmsg);$i++)
  907. {
  908. $error_msg .= '<br />'.$errmsg[$i];
  909. }
  910. $template->assign_vars(array(
  911. 'ERROR_MESSAGE' => $error_msg)
  912. );
  913. $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
  914. }
  915. if(!$userdata['session_logged_in'] && $mode != 'edit')
  916. {
  917. $template->assign_block_vars('username',array(
  918. 'USERNAME' => $username
  919. ));
  920. }
  921. $me = unprepare_message($me);
  922. $ti = unprepare_message($ti);
  923. $template->assign_vars(array(
  924. 'TITLE' => stripslashes($ti),
  925. 'MESSAGE' => stripslashes($me),
  926.  
  927. 'L_GB_POST' => $lang['gb_post2'],
  928. 'L_TITLE' => $lang['gb_title'],
  929. 'L_MESSAGE_BODY' => $lang['Message_body'],
  930. 'L_SUBMIT' => $lang['Submit'],
  931. 'L_USERNAME' => $lang['Username'],
  932.  
  933. 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
  934. 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
  935. 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
  936. 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
  937. 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
  938. 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
  939. 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
  940. 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
  941. 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
  942. 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
  943. 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
  944. 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
  945. 'L_EMPTY_MESSAGE' => $lang['Empty_message'],
  946.  
  947. 'L_FONT_COLOR' => $lang['Font_color'],
  948. 'L_COLOR_DEFAULT' => $lang['color_default'],
  949. 'L_COLOR_DARK_RED' => $lang['color_dark_red'],
  950. 'L_COLOR_RED' => $lang['color_red'],
  951. 'L_COLOR_ORANGE' => $lang['color_orange'],
  952. 'L_COLOR_BROWN' => $lang['color_brown'],
  953. 'L_COLOR_YELLOW' => $lang['color_yellow'],
  954. 'L_COLOR_GREEN' => $lang['color_green'],
  955. 'L_COLOR_OLIVE' => $lang['color_olive'],
  956. 'L_COLOR_CYAN' => $lang['color_cyan'],
  957. 'L_COLOR_BLUE' => $lang['color_blue'],
  958. 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
  959. 'L_COLOR_INDIGO' => $lang['color_indigo'],
  960. 'L_COLOR_VIOLET' => $lang['color_violet'],
  961. 'L_COLOR_WHITE' => $lang['color_white'],
  962. 'L_COLOR_BLACK' => $lang['color_black'],
  963.  
  964. 'L_FONT_SIZE' => $lang['Font_size'],
  965. 'L_FONT_TINY' => $lang['font_tiny'],
  966. 'L_FONT_SMALL' => $lang['font_small'],
  967. 'L_FONT_NORMAL' => $lang['font_normal'],
  968. 'L_FONT_LARGE' => $lang['font_large'],
  969. 'L_FONT_HUGE' => $lang['font_huge'],
  970.  
  971. 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
  972. 'L_STYLES_TIP' => $lang['Styles_tip'],
  973.  
  974. 'U_PROFILE' => append_sid('profile.'.$phpEx.'?mode=wall&amp;'.POST_USERS_URL.'='.$this->uid),
  975.  
  976. 'S_POST_ACTION' => $action)
  977. );
  978. $template->pparse('body');
  979. include_once($phpbb_root_path."/includes/page_tail.".$phpEx);
  980. }
  981. function deleteall()
  982. {
  983. global $db,$lang,$phpEx;
  984. $sql = "DELETE FROM ".PROFILE_GUESTBOOK_TABLE." WHERE user_id = ".$this->uid."";
  985. if(!$db->sql_query($sql))
  986. {
  987. message_die(GENERAL_ERROR,"Could not delete guestbook posts!","",__LINE__,__FILE__,$sql);
  988. }
  989. $msg = '<br /><a href="' . $this->append_sid("gb=view") . '">'.$lang['back_pro'].'</a>';
  990. message_die(GENERAL_MESSAGE,$lang['gb_all_del'] . $msg);
  991. }
  992. function delete()
  993. {
  994. global $lang,$HTTP_POST_VARS,$db,$phpEx;
  995. $id = intval($HTTP_POST_VARS['gb_id']);
  996. if(empty($id))
  997. {
  998. message_die(GENERAL_ERROR,$lang['gb_no_id'],"",__LINE__,__FILE__);
  999. }
  1000. $sql = "DELETE FROM ".PROFILE_GUESTBOOK_TABLE." WHERE user_id = ".$this->uid." AND gb_id = $id";
  1001. if(!$db->sql_query($sql))
  1002. {
  1003. message_die(GENERAL_ERROR,"Could not delete guestbook posts!","",__LINE__,__FILE__,$sql);
  1004. }
  1005. $msg = '<br /><a href="' . $this->append_sid("gb=view") . '">'.$lang['back_pro'].'</a>';
  1006. message_die(GENERAL_MESSAGE,$lang['gb_del'] . $msg);
  1007. }
  1008. function append_sid($url)
  1009. {
  1010.  
  1011. $url = $this->url_intern . '&amp;' . $url;
  1012. $url = append_sid($url);
  1013. return $url;
  1014. }
  1015. function version_check()
  1016. {
  1017. global $phpbb_root_path,$lang,$board_config,$phpEx;
  1018. $text = "";
  1019. if(is_writable($phpbb_root_path."/cache/"))
  1020. {
  1021. if(file_exists($phpbb_root_path."/cache/profilemod.".$phpEx))
  1022. {
  1023. include($phpbb_root_path."/cache/profilemod.".$phpEx);
  1024. define('VERSION_CHECK_DELAY', 86400);
  1025. $now = time();
  1026. $version_check_delay = intval($last_check);
  1027. $check = empty($version_check_delay) || (($now - $version_check_delay) > VERSION_CHECK_DELAY);
  1028. if(!$check){
  1029. $this->url = $url;
  1030. }
  1031. }
  1032. else
  1033. {
  1034. $check = true;
  1035. }
  1036. }
  1037. if($check)
  1038. {
  1039. $current_version = explode('.', $this->version);
  1040. $minor_revision = intval( $current_version[2]);
  1041.  
  1042. $errno = 0;
  1043. $errstr = $version_info = '';
  1044.  
  1045. if ($fsock = @fsockopen('www.paulscripts.nl', 80, $errno, $errstr))
  1046. {
  1047. @fputs($fsock, "GET /profile.txt HTTP/1.1\r\n");
  1048. @fputs($fsock, "HOST: www.paulscripts.nl\r\n");
  1049. @fputs($fsock, "Connection: close\r\n\r\n");
  1050.  
  1051. $get_info = false;
  1052. while (!@feof($fsock))
  1053. {
  1054. if ($get_info)
  1055. {
  1056. $version_info .= @fread($fsock, 1024);
  1057. }
  1058. else
  1059. {
  1060. if (@fgets($fsock, 1024) == "\r\n")
  1061. {
  1062. $get_info = true;
  1063. }
  1064. }
  1065. }
  1066. @fclose($fsock);
  1067.  
  1068. $version_info = explode("\n", $version_info);
  1069. $latest_head_revision = intval( $version_info[0]);
  1070. $latest_minor_revision = intval($version_info[2]);
  1071. $latest_version = intval($version_info[0]) . '.' . intval($version_info[1]) . '.' . intval($version_info[2]);
  1072. $this->url = $version_info[3];
  1073.  
  1074. if ($current_version[0] == intval($version_info[0]) && $current_version[1] == intval($version_info[1]) && $current_version[2] >= intval($version_info[2]))
  1075. {
  1076. $version_info = sprintf($lang['ok_check'],$this->version,$this->url,$this->url);
  1077. }
  1078. else
  1079. {
  1080. $version_info = sprintf($lang['not_ok_check'],$this->version,$latest_version,$this->url,$this->url);
  1081. }
  1082. }
  1083. else
  1084. {
  1085. if ($errstr)
  1086. {
  1087. $version_info = sprintf($lang['gb_error_check'], $errstr);
  1088. }
  1089. else
  1090. {
  1091. $version_info = $lang['Socket_functions_disabled'];
  1092. }
  1093. }
  1094. $text .= $version_info;
  1095. if(is_writable($phpbb_root_path."/cache/")){
  1096. @unlink($phpbb_root_path."/cache/profilemod.".$phpEx);
  1097. $o = fopen($phpbb_root_path."/cache/profilemod.".$phpEx,"w");
  1098. if(!$o)
  1099. {
  1100. message_die(GENERAL_ERROR,"Could not open $phpbb_root_path/cache/profilemod.".$phpEx."!","",__LINE__,__FILE__);
  1101. }
  1102. fwrite($o,"<"."?php\n\$last_check = ".time().";\n\$url = '".$this->url."';\n?".">");
  1103. fclose($o);
  1104. }
  1105. }
  1106. else
  1107. {
  1108. $text .= sprintf($lang['not_check'],$this->version,$this->url,$this->url);
  1109. }
  1110. return $text;
  1111. }
  1112. }
  1113. ?>