56 $a = $this->fdb->searchMessages (
filter_to_db($text),
filter_to_db($u), $forum, $type, (
'posts' == $disp ? 1 : 0), $start, $num);
59 return '<error>[L[Wrong search type]]</error>';
62 $ws = preg_split(
"/\s+/", $text);
70 if (!$this->
_checkUserPerm (
'', $r[
'forum_type'],
'read', $r[
'forum_id']))
81 $wreg = preg_quote($w,
'/');
82 $r[
'topic_title'] = preg_replace (
"/($wreg)/i",
"<span style=\"background-color:yellow\">$w</span>", $r[
'topic_title']);
89 $ui[$r[
'user']] = $aa;
94 <sr date=
"{$r['date']}">
95 <c
id=
"{$r['cat_id']}" uri=
"{$r['cat_uri']}">{$r[
'cat_name']}</c>
96 <f
id=
"{$r['forum_id']}" uri=
"{$r['forum_uri']}">{$r[
'forum_title']}</f>
97 <t
id=
"{$r['topic_id']}" uri=
"{$r['topic_uri']}">{$r[
'topic_title']}</t>
99 <avatar>{$ui[$r[
'user']][
'avatar']}</avatar>
100 <avatar_medium>{$ui[$r[
'user']][
'avatar64']}</avatar_medium>
101 <profile>{$ui[$r[
'user']][
'url']}</profile>
102 <profile_title>{$ui[$r[
'user']][
'title']}</profile_title>
103 <onclick>{$ui[$r[
'user']][
'onclick']}</onclick>
104 <role>{$ui[$r[
'user']][
'role']}</role>
113 if (!$this->
_checkUserPerm (
'', $r[
'forum_type'],
'read', $r[
'forum_id']))
118 foreach ($ws
as $w) {
120 $wreg = preg_quote($w,
'/');
121 $ind = preg_match(
"/([^>]*<)/i", $r[
'post_text'], $ind );
123 $r[
'post_text'] = preg_replace(
"/($wreg)(?=[^>]*<)/i",
"<span style=\"background-color:yellow\">$w</span>",
"<div>{$r['post_text']}</div>");
125 $r[
'post_text'] = preg_replace(
"/($wreg)/i",
"<span style=\"background-color:yellow\">$w</span>", $r[
'post_text']);
136 foreach ($ws
as $w) {
137 $wreg = preg_quote($w,
'/');
138 $r[
'topic_title'] = preg_replace (
"/($wreg)/i",
"<span style=\"background-color:yellow\">$w</span>", $r[
'topic_title']);
144 $ui[$r[
'user']] = $aa;
149 <sr date=
"{$r['date']}">
150 <c
id=
"{$r['cat_id']}" uri=
"{$r['cat_uri']}">{$r[
'cat_name']}</c>
151 <f
id=
"{$r['forum_id']}" uri=
"{$r['forum_uri']}">{$r[
'forum_title']}</f>
152 <t
id=
"{$r['topic_id']}" uri=
"{$r['topic_uri']}">{$r[
'topic_title']}</t>
153 <p
id=
"{$r['post_id']}">{$r[
'post_text']}</p>
154 <u
name=
"{$r['user']}">
155 <avatar>{$ui[$r[
'user']][
'avatar']}</avatar>
156 <avatar_medium>{$ui[$r[
'user']][
'avatar64']}</avatar_medium>
157 <profile>{$ui[$r[
'user']][
'url']}</profile>
158 <profile_title>{$ui[$r[
'user']][
'title']}</profile_title>
159 <onclick>{$ui[$r[
'user']][
'onclick']}</onclick>
160 <role>{$ui[$r[
'user']][
'role']}</role>
174 <search_text><![CDATA[$text]]></search_text>
176 <text><![CDATA[$textEncoded]]></text>
178 <forum>$forum</forum>
179 <user><![CDATA[$userEncoded]]></user>
187 $this->
setTitle (
'<![CDATA[[L[Search Results For:]]' . $text .
']]>');
189 return $this->
addHeaderFooter ($li,
"<search>{$sp}<pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>$s</search>");
191 return "<root>$cu<search>{$sp}<pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>$s</search></root>";
209 $this->
setTitle (
'<![CDATA[[L[Search The Forum]]]]>');
213 return "<root>$cu<search>$s</search></root>";
223 $forum_id = isset(
$f[
'forum_id']) ?
$f[
'forum_id'] : 0;
225 if (!$this->
_checkUserPerm (
'', isset(
$f[
'forum_type']) ?
$f[
'forum_type'] :
'public',
'post', $forum_id)) {
239 <
id>{
$f[
'forum_id']}</
id>
240 <uri>{
$f[
'forum_uri']}</uri>
241 <title>{
$f[
'forum_title']}</title>
242 <desc>{
$f[
'forum_desc']}</desc>
247 $cat = $this->fdb->getCat (
$f[
'cat_id']);
251 <
id>{
$f[
'cat_id']}</
id>
252 <uri>{$cat[
'cat_uri']}</uri>
253 <title>{$cat[
'cat_name']}</title>
262 $signature = $this->fdb->getSignature ($u);
266 $this->
setTitle (
'<![CDATA[[L[New Topic]]]]>');
268 return $this->
addHeaderFooter ($li,
"<new_topic sticky=\"$sticky\">{$x2}{$x1}{$x3}<signature>{$signature}</signature></new_topic>");
270 return "<root>$cu<new_topic sticky=\"$sticky\">{$x2}{$x1}{$x3}<signature>{$signature}</signature></new_topic></root>";
279 $f = $this->fdb->getForum ($forum_id);
281 $t = $this->fdb->getTopic ((
int)$topic_id);
283 if (!$this->
_checkUserPerm (
'',
$f[
'forum_type'],
'post', (
int)$forum_id) || $t[
'topic_locked']) {
292 <
id>{
$f[
'forum_id']}</
id>
293 <uri>{
$f[
'forum_uri']}</uri>
294 <title>{
$f[
'forum_title']}</title>
295 <desc>{
$f[
'forum_desc']}</desc>
301 $signature = $this->fdb->getSignature ($u);
305 return "<root>$cu<new_topic>$x1<topic><id>$topic_id</id></topic><signature>{$signature}</signature></new_topic></root>";
317 $post_id = (int)$post_id;
318 if (!$post_id)
return false;
322 $t = $this->fdb->getTopicByPostId ($post_id);
323 $topic_id = $t[
'topic_id'];
325 $f = $this->fdb->getForum ($t[
'forum_id']);
326 $forum_id =
$f[
'forum_id'];
330 $forum_type =
$f[
'forum_type'];
332 if (!$this->
_checkUserPerm (
'', $forum_type,
'read', $forum_id)) {
339 $gl_allow_hide_posts = 0;
340 $gl_allow_unhide_posts = 0;
341 $gl_allow_download = 0;
350 $gl_allow_hide_posts = 1;
353 $gl_allow_unhide_posts = 1;
356 $gl_allow_download = 1;
360 $r = $this->fdb->getPost($post_id, $u);
364 $ui[$r[
'user']] = $aa;
365 $ui[$r[
'user']][
'posts'] = (int)$this->fdb->getUserPosts($r[
'user']);
368 $allow_edit = $gl_allow_edit;
369 $allow_del = $gl_allow_del;
395 <
id>{
$f[
'forum_id']}</
id>
396 <uri>{
$f[
'forum_uri']}</uri>
400 <uri>{$t[
'topic_uri']}</uri>
402 <
post id=
"{$r['post_id']}" force_show=
"$force_show">
403 <text>{$r[
'post_text']}</text>
404 <when>{$r[
'when']}</when>
405 <allow_edit>$allow_edit</allow_edit>
406 <allow_del>$allow_del</allow_del>
407 <allow_hide_posts>$gl_allow_hide_posts</allow_hide_posts>
408 <allow_unhide_posts>$gl_allow_unhide_posts</allow_unhide_posts>
409 <allow_download>$gl_allow_download</allow_download>
410 <points>{$r[
'votes']}</points>
411 <hidden>{$r[
'hidden']}</hidden>
412 <vote_user_point>{$r[
'vote_user_point']}</vote_user_point>
413 <user posts=
"{$ui[$r['user']]['posts']}" name=
"{$r['user']}">
414 <avatar>{$ui[$r[
'user']][
'avatar']}</avatar>
415 <avatar_medium>{$ui[$r[
'user']][
'avatar64']}</avatar_medium>
416 <url>{$ui[$r[
'user']][
'url']}</url>
417 <title>{$ui[$r[
'user']][
'title']}</title>
418 <onclick>{$ui[$r[
'user']][
'onclick']}</onclick>
419 <role>{$ui[$r[
'user']][
'role']}</role>
421 <attachments>$files</attachments>
422 <min_point>{
$gConf[
'min_point']}</min_point>
440 $a = $this->fdb->getPostsByUri(
filter_to_db($topic_uri), $u);
441 $topic_id = $a[0][
'topic_id'];
444 $f = $this->fdb->getForum ($a[0][
'forum_id']);
445 $forum_id =
$f[
'forum_id'];
446 $forum_type =
$f[
'forum_type'];
448 if (!$this->
_checkUserPerm ($u, $forum_type,
'read', $forum_id)) {
452 $t = $this->fdb->getTopic ($topic_id);
454 $gl_allow_hide_topics = 0;
455 $gl_allow_unhide_topics = 0;
456 $gl_allow_lock_topics = 0;
457 $gl_allow_stick_topics = 0;
460 $gl_allow_hide_topics = 1;
463 $gl_allow_unhide_topics = 1;
465 if (!$gl_allow_unhide_topics && !$gl_allow_hide_topics && $t[
'topic_hidden'])
469 $gl_allow_lock_topics = 1;
472 $gl_allow_stick_topics = 1;
479 $gl_allow_hide_posts = 0;
480 $gl_allow_unhide_posts = 0;
482 $gl_allow_move_topics = 0;
483 $gl_allow_del_topics = 0;
484 $gl_allow_download = 0;
493 $gl_allow_hide_posts = 1;
496 $gl_allow_unhide_posts = 1;
499 $gl_allow_move_topics = 1;
502 $gl_allow_del_topics = 1;
505 $gl_allow_download = 1;
512 $signature = $this->fdb->getSignature ($r[
'user']);
514 $ui[$r[
'user']] = $aa;
515 $ui[$r[
'user']][
'signature'] = $signature;
516 $ui[$r[
'user']][
'posts'] = (int)$this->fdb->getUserPosts($r[
'user']);
519 $allow_edit = $gl_allow_edit;
520 $allow_del = $gl_allow_del;
522 if (!$allow_edit && $r[
'user'] == $u) {
527 if (!$allow_del && $r[
'user'] == $u) {
539 <
post id=
"{$r['post_id']}" force_show=
"0">
540 <text>{$r[
'post_text']}</text>
541 <when>{$r[
'when']}</when>
542 <allow_edit>$allow_edit</allow_edit>
543 <allow_del>$allow_del</allow_del>
544 <allow_hide_posts>$gl_allow_hide_posts</allow_hide_posts>
545 <allow_unhide_posts>$gl_allow_unhide_posts</allow_unhide_posts>
546 <allow_download>$gl_allow_download</allow_download>
547 <points>{$r[
'votes']}</points>
548 <hidden>{$r[
'hidden']}</hidden>
549 <vote_user_point>{$r[
'vote_user_point']}</vote_user_point>
550 <user posts=
"{$ui[$r['user']]['posts']}" name=
"{$r['user']}">
551 <avatar>{$ui[$r[
'user']][
'avatar']}</avatar>
552 <avatar_medium>{$ui[$r[
'user']][
'avatar64']}</avatar_medium>
553 <url>{$ui[$r[
'user']][
'url']}</url>
554 <title>{$ui[$r[
'user']][
'title']}</title>
555 <onclick>{$ui[$r[
'user']][
'onclick']}</onclick>
556 <role>{$ui[$r[
'user']][
'role']}</role>
557 <signature>{$ui[$r[
'user']][
'signature']}</signature>
559 <attachments>$files</attachments>
560 <min_point>{
$gConf[
'min_point']}</min_point>
566 $cat = $this->fdb->getCat (
$f[
'cat_id']);
570 <
id>{$cat[
'cat_id']}</
id>
571 <uri>{$cat[
'cat_uri']}</uri>
572 <title>{$cat[
'cat_name']}</title>
580 <
id>{
$f[
'forum_id']}</
id>
581 <uri>{
$f[
'forum_uri']}</uri>
582 <title>{$t[
'forum_title']}</title>
583 <desc>{$t[
'forum_desc']}</desc>
588 $topic_flagged = $this->fdb->isFlagged ($rr[
'topic_id'], $u) ? 1 : 0;
591 <
id>{$t[
'topic_id']}</
id>
592 <uri>{$t[
'topic_uri']}</uri>
593 <title>{$t[
'topic_title']}</title>
594 <locked>{$t[
'topic_locked']}</locked>
595 <sticky>{$t[
'topic_sticky']}</sticky>
596 <hidden>{$t[
'topic_hidden']}</hidden>
597 <flagged>{$topic_flagged}</flagged>
598 <allow_hide_topics>$gl_allow_hide_topics</allow_hide_topics>
599 <allow_unhide_topics>$gl_allow_unhide_topics</allow_unhide_topics>
600 <allow_move_topics>$gl_allow_move_topics</allow_move_topics>
601 <allow_del_topics>$gl_allow_del_topics</allow_del_topics>
602 <allow_lock_topics>$gl_allow_lock_topics</allow_lock_topics>
603 <allow_stick_topics>$gl_allow_stick_topics</allow_stick_topics>
610 return $this->
addHeaderFooter ($li,
"<posts>{$x0}{$x1}{$x2}{$p}</posts>");
615 return "<root><logininfo>" .
array2xml($li) .
"</logininfo>$cu<posts>{$x0}{$x1}{$x2}{$p}</posts></root>";
636 <title><![CDATA[
$sTitle]]></title>
637 <desc><![CDATA[
$sDesc]]></desc>
643 $user_last_act = (int)$this->fdb->getUserLastActivity ($user);
646 $a = $this->fdb->$sFunc($user, $start, $num);
649 $lp = $this->fdb->getTopicPost($r[
'topic_id'],
'last');
650 $fp = $this->fdb->getTopicPost($r[
'topic_id'],
'first');
654 $ui[$fp[
'user']] = $aa;
656 $ui[$lp[
'user']] = $aa;
658 $td = $this->fdb->getTopicDesc ($r[
'topic_id']);
667 $new_topic = $this->
isNewTopic ($r[
'topic_id'], $r[
'last_post_when'], $user_last_act) ? 1 : 0;
675 <topic
id=
"{$r['topic_id']}" new=
"$new_topic" lpt=
"{$r['last_post_when']}" lut=
"{$user_last_act}">
676 <uri>{$r[
'topic_uri']}</uri>
677 <title>{$r[
'topic_title']}</title>
679 <count>{$r[
'count_posts']}</count>
681 <avatar>{$ui[$lp[
'user']][
'avatar']}</avatar>
682 <avatar_medium>{$ui[$lp[
'user']][
'avatar64']}</avatar_medium>
683 <profile>{$ui[$lp[
'user']][
'url']}</profile>
684 <profile_title>{$ui[$lp[
'user']][
'title']}</profile_title>
685 <profile_link>{$ui[$lp[
'user']][
'link']}</profile_link>
686 <onclick>{$ui[$lp[
'user']][
'onclick']}</onclick>
687 <role>{$ui[$lp[
'user']][
'role']}</role>
689 <last_d>{$lp[
'when']}</last_d>
691 <avatar>{$ui[$fp[
'user']][
'avatar']}</avatar>
692 <avatar_medium>{$ui[$fp[
'user']][
'avatar64']}</avatar_medium>
693 <profile>{$ui[$fp[
'user']][
'url']}</profile>
694 <profile_title>{$ui[$fp[
'user']][
'title']}</profile_title>
695 <profile_link>{$ui[$fp[
'user']][
'link']}</profile_link>
696 <onclick>{$ui[$fp[
'user']][
'onclick']}</onclick>
697 <role>{$ui[$fp[
'user']][
'role']}</role>
699 <first_d>{$fp[
'when']}</first_d>
709 return $this->
addHeaderFooter ($li,
"<topics><pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>{$x2}{$x1}{$t}</topics>");
712 return "<root>$cu<topics><pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>{$x2}{$x1}{$t}</topics></root>";
722 return $this->
getXxxTopicsXML ($wp,
'[L[Hidden Topics]]',
'[L[Hidden topics]]',
'getHiddenTopics', $start);
731 return $this->
getXxxTopicsXML ($wp,
'[L[My Topics]]',
'[L[Topics you participate in]]',
'getMyThreadsTopics', $start);
740 return $this->
getXxxTopicsXML ($wp,
'[L[Flagged topics]]',
'[L[Topics you have flagged]]',
'getMyFlaggedTopics', $start);
754 $forum_id =
$f[
'forum_id'];
767 <
id>{
$f[
'forum_id']}</
id>
768 <uri>{
$f[
'forum_uri']}</uri>
769 <title>{
$f[
'forum_title']}</title>
770 <desc>{
$f[
'forum_desc']}</desc>
775 $cat = $this->fdb->getCat (
$f[
'cat_id']);
779 <
id>{$cat[
'cat_id']}</
id>
780 <uri>{$cat[
'cat_uri']}</uri>
781 <title>{$cat[
'cat_name']}</title>
785 $user_last_act = (int)$this->fdb->getUserLastActivity ($user);
787 $a = $this->fdb->getTopics($forum_id, $start);
793 $ui[$r[
'first_post_user']] = $aa;
795 $ui[$r[
'last_post_user']] = $aa;
797 $td = $this->fdb->getTopicDesc ($r[
'topic_id']);
806 $new_topic = $this->
isNewTopic ($r[
'topic_id'], $r[
'last_post_when'], $user_last_act) ? 1 : 0;
813 <topic
id=
"{$r['topic_id']}" new=
"$new_topic" lpt=
"{$r['last_post_when']}" lut=
"{$user_last_act}" sticky=
"{$r['topic_sticky']}" locked=
"{$r['topic_locked']}">
814 <uri>{$r[
'topic_uri']}</uri>
815 <title>{$r[
'topic_title']}</title>
817 <count>{$r[
'count_posts']}</count>
819 <avatar>{$ui[$r[
'last_post_user']][
'avatar']}</avatar>
820 <avatar_medium>{$ui[$r[
'last_post_user']][
'avatar64']}</avatar_medium>
821 <profile>{$ui[$r[
'last_post_user']][
'url']}</profile>
822 <profile_title>{$ui[$r[
'last_post_user']][
'title']}</profile_title>
823 <profile_link>{$ui[$r[
'last_post_user']][
'link']}</profile_link>
824 <onclick>{$ui[$r[
'last_post_user']][
'onclick']}</onclick>
825 <role>{$ui[$r[
'last_post_user']][
'role']}</role>
827 <last_d>{$r[
'last_when']}</last_d>
829 <avatar>{$ui[$r[
'first_post_user']][
'avatar']}</avatar>
830 <avatar_medium>{$ui[$r[
'first_post_user']][
'avatar64']}</avatar_medium>
831 <profile>{$ui[$r[
'first_post_user']][
'url']}</profile>
832 <profile_title>{$ui[$r[
'first_post_user']][
'title']}</profile_title>
833 <profile_link>{$ui[$r[
'first_post_user']][
'link']}</profile_link>
834 <onclick>{$ui[$r[
'first_post_user']][
'onclick']}</onclick>
835 <role>{$ui[$r[
'first_post_user']][
'role']}</role>
837 <first_d>{$r[
'first_when']}</first_d>
842 $num = $this->fdb->getTopicsNum($forum_id);
848 return $this->
addHeaderFooter ($li,
"<topics><pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>{$x2}{$x1}{$t}</topics>");
851 return "<root>$cu<topics><pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>{$x2}{$x1}{$t}</topics></root>";
867 $user_last_act = (int)$this->fdb->getUserLastActivity ($user);
869 $a = $this->fdb->getRecentTopics($start);
873 if (!$this->
_checkUserPerm (
'', $r[
'forum_type'],
'read', $r[
'forum_id']))
878 $ui[$r[
'first_post_user']] = $aa;
880 $ui[$r[
'last_post_user']] = $aa;
885 $new_topic = $this->
isNewTopic ($r[
'topic_id'], $r[
'last_post_when'], $user_last_act) ? 1 : 0;
895 <topic
id=
"{$r['topic_id']}" new=
"$new_topic" lpt=
"{$r['last_post_when']}" lut=
"{$user_last_act}" sticky=
"{$r['topic_sticky']}" locked=
"{$r['topic_locked']}">
896 <uri>{$r[
'topic_uri']}</uri>
897 <title>{$r[
'topic_title']}</title>
899 <count>{$r[
'count_posts']}</count>
901 <avatar>{$ui[$r[
'last_post_user']][
'avatar']}</avatar>
902 <avatar_medium>{$ui[$r[
'last_post_user']][
'avatar64']}</avatar_medium>
903 <profile>{$ui[$r[
'last_post_user']][
'url']}</profile>
904 <profile_title>{$ui[$r[
'last_post_user']][
'title']}</profile_title>
905 <profile_link>{$ui[$r[
'last_post_user']][
'link']}</profile_link>
906 <onclick>{$ui[$r[
'last_post_user']][
'onclick']}</onclick>
907 <role>{$ui[$r[
'last_post_user']][
'role']}</role>
909 <last_d>{$r[
'last_when']}</last_d>
911 <avatar>{$ui[$r[
'first_post_user']][
'avatar']}</avatar>
912 <avatar_medium>{$ui[$r[
'first_post_user']][
'avatar64']}</avatar_medium>
913 <profile>{$ui[$r[
'first_post_user']][
'url']}</profile>
914 <profile_title>{$ui[$r[
'first_post_user']][
'title']}</profile_title>
915 <profile_link>{$ui[$r[
'first_post_user']][
'link']}</profile_link>
916 <onclick>{$ui[$r[
'first_post_user']][
'onclick']}</onclick>
917 <role>{$ui[$r[
'first_post_user']][
'role']}</role>
919 <first_d>{$r[
'first_when']}</first_d>
920 <forum
id=
"{$r['forum_id']}" uri=
"{$r['forum_uri']}">{$r[
'forum_title']}</forum>
921 <cat
id=
"{$r['cat_id']}" uri=
"{$r['cat_uri']}">{$r[
'cat_name']}</cat>
926 $num = $this->fdb->getRecentTopicsNum();
933 $this->
setTitle(
'[L[Recent Topics]]');
935 return $this->
addHeaderFooter ($li,
"<topics><pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>{$t}</topics>$sCategories");
938 return "<root>$cu<topics><pages num=\"$num\" per_page=\"{$gConf['topics_per_page']}\">$p</pages>{$t}</topics>$sCategories</root>";
947 $a = unserialize($_COOKIE[
'track_topics']);
948 if (!is_array($a))
return array ();
957 $a = unserialize($_COOKIE[
'track_topics']);
958 if (!is_array($a)) $a = array ();
959 $a[$topic_id] =
time();
960 setcookie (
'track_topics', serialize($a));
967 function isNewTopic ($topic_id, $topic_last_time, $user_last_time)
971 if ($a[$topic_id] && $topic_last_time > $a[$topic_id])
973 else if ($a[$topic_id])
976 if (!$user_last_time)
return 1;
978 if ($topic_last_time > $user_last_time)
return 1;
988 $a = $this->fdb->getCategs();
991 $c .=
"<categ id=\"{$r['cat_id']}\" uri=\"{$r['cat_uri']}\">";
993 $c .=
"<title>{$r['cat_name']}</title>";
994 $c .=
'<forums>' . $this->
getForumsShortXML ($r[
'cat_id'], 0, $sCheckPermission) .
'</forums>';
998 return "<categs>$c</categs>";
1006 $c = $root ?
'<forums>' :
'';
1007 $aa = $this->fdb->getForums ($cat);
1008 foreach ($aa
as $rr) {
1009 if ($sCheckPermission && !$this->
_checkUserPerm (
'', $rr[
'forum_type'], $sCheckPermission, $rr[
'forum_id']))
1015 <forum
id=
"{$rr['forum_id']}">
1016 <uri>{$rr[
'forum_uri']}</uri>
1017 <title>{$rr[
'forum_title']}</title>
1023 return $root ? ($c .
"</forums>\n") : $c;
1035 $aa = $this->fdb->getForumsByCatUri (
filter_to_db($cat));
1037 foreach ($aa
as $rr) {
1038 if (!$this->
_checkUserPerm (
'', $rr[
'forum_type'],
'read', $rr[
'forum_id']))
1044 if (!$rr[
'forum_last_ts'])
1045 $rr[
'forum_last'] =
'';
1050 <forum
id=
"{$rr['forum_id']}" new=
"0" cat=
"$cat">
1051 <uri>{$rr[
'forum_uri']}</uri>
1052 <title>{$rr[
'forum_title']}</title>
1053 <desc>{$rr[
'forum_desc']}</desc>
1055 <posts>{$rr[
'forum_posts']}</posts>
1056 <topics>{$rr[
'forum_topics']}</topics>
1057 <last>{$rr[
'forum_last']}</last>
1065 return '<root>' . $cu . $c .
"</forums></root>\n";
1080 if (isset($p[
'manage_forum']) && $p[
'manage_forum'] && !$this->
isAdmin()) {
1095 return "<root>$cu<logininfo>".array2xml($li).
"</logininfo><page>{$s}{$lt}</page></root>";
1106 $a = $this->fdb->getCategs();
1108 foreach ($a
as $r) {
1109 $icon_url = $r[
'cat_icon'] ?
$gConf[
'url'][
'icon'] . $r[
'cat_icon'] :
'';
1110 $c .=
"<categ id=\"{$r['cat_id']}\" uri=\"{$r['cat_uri']}\" icon=\"$icon_url\" count_posts=\"{$r['count_posts']}\" count_topics=\"{$r['count_topics']}\" count_forums=\"{$r['count_forums']}\">";
1112 $c .=
"<title>{$r['cat_name']}</title>";
1114 if ((isset($p[
'cat']) && $p[
'cat'] == $r[
'cat_uri']) || ($r[
'cat_expanded'] && !isset($p[
'cat']))) {
1116 $c .=
'<forums>'.$this->getForumsXML ($r[
'cat_uri'], 0) .
'</forums>';
1121 $s =
"<categs>$c</categs>";
1123 if ($first_load && isset($p[
'action']) &&
'goto' == $p[
'action'] && isset($p[
'forum_id']))
1124 $s .=
"<onload>f.selectForum('" . $p[
'forum_id'] .
"', 0)</onload>";
1126 if ($first_load && isset($p[
'action']) &&
'goto' == $p[
'action'] && isset($p[
'topic_id']))
1127 $s .=
"<onload>f.selectTopic('" . $p[
'topic_id'] .
"')</onload>";
1134 $lt =
"<live_tracker>" . $this->
getLivePostsXML() .
"</live_tracker>";
1144 if ($ts < (
time() - 172800))
1147 $a = $this->fdb->getLivePosts ($count, $ts);
1149 foreach ($a
as $r) {
1152 $ui[$r[
'user']] = $aa;
1163 <
post id=
"{$r['post_id']}" ts=
"{$r['ts']}">
1164 <text>{$r[
'post_text']}</text>
1165 <user>{$r[
'user']}</user>
1166 <date>{$r[
'when']}</date>
1168 <avatar>{$ui[$r[
'user']][
'avatar']}</avatar>
1169 <avatar_medium>{$ui[$r[
'user']][
'avatar64']}</avatar_medium>
1170 <profile>{$ui[$r[
'user']][
'url']}</profile>
1171 <profile_title>{$ui[$r[
'user']][
'title']}</profile_title>
1172 <onclick>{$ui[$r[
'user']][
'onclick']}</onclick>
1173 <role>{$ui[$r[
'user']][
'role']}</role>
1175 <topic
id=
"{$r['topic_id']}" uri=
"{$r['topic_uri']}">{$r[
'topic_title']}</topic>
1176 <forum
id=
"{$r['forum_id']}" uri=
"{$r['forum_uri']}">{$r[
'forum_title']}</forum>
1177 <cat
id=
"{$r['cat_id']}" uri=
"{$r['cat_uri']}">{$r[
'cat_name']}</cat>
1178 <base>{
$gConf[
'url'][
'base']}</base>
1192 return '<ret>' . (int)$this->fdb->getNewPostTs ($ts) .
'</ret>';
1204 $f = $this->fdb->getForum ((
int)$p[
'forum_id']);
1206 $t = $this->fdb->getTopic ((
int)$p[
'topic_id']);
1208 if (!$this->
_checkUserPerm (
'',
$f[
'forum_type'],
'post', (
int)$p[
'forum_id']) || $t[
'topic_locked'] ||
ch_is_spam($p[
'topic_text'])) {
1212 <script language=
"javascript" type=
"text/javascript">
1213 window.parent.document.f.accessDenied();
1223 $p[
'forum_id'] = (int)$p[
'forum_id'];
1224 $p[
'topic_id'] = (int)$p[
'topic_id'];
1231 if ($t[
'topic_posts'] >=
$gConf[
'max_posts']) {
1235 $iReplyId = $this->fdb->postReply ($p[
'forum_id'], $t[
'topic_id'], $p[
'topic_text'], $user);
1236 $aReply = $this->fdb->getPost($iReplyId,
'');
1242 $t = $this->fdb->getTopic($t[
'topic_id']);
1245 call_user_func_array ($this->
onPostReply, array($t, $aReply[
'post_text'], $user));
1250 <script language=
"javascript" type=
"text/javascript">
1251 if (!$isUploadSuccess)
1252 window.parent.alert (
'[L[Some or all files upload failed]]');
1253 window.parent.document.f.replySuccess(
'{$f['forum_uri
']}',
'{$t['topic_uri
']}');
1273 $sTopicUri = $t[
'topic_uri'];
1274 $iPos = mb_strpos($t[
'topic_uri'],
'.');
1275 if (
false !==
$iPos) {
1276 $iTopicIndexOld = mb_substr($t[
'topic_uri'],
$iPos + 1);
1277 if ((
int)$iTopicIndexOld) {
1278 $iTopicIndex = (int)$iTopicIndexOld;
1279 $sTopicUri = mb_substr($t[
'topic_uri'], 0,
$iPos);
1286 $sNewTopicUri = $sTopicUri .
'.' . (++$iTopicIndex);
1290 $aTopicFirst = $this->fdb->getTopicByUri($sTopicUri);
1291 $sNewTopicSubj = ($aTopicFirst ? $aTopicFirst[
'topic_title'] : $t[
'topic_title']) . sprintf(
'[L[continue_topic_suffix - %d]]', $iTopicIndex);
1292 $sOldTopicUrl =
$gConf[
'url'][
'base'] . sprintf(
$gConf[
'rewrite'][
'topic'], $t[
'topic_uri']);
1293 $sNewTopicText = sprintf(
'[L[continue_topic_first %s]]',
'<a href="' . $sOldTopicUrl .
'">' . $t[
'topic_title'] .
'</a>');
1296 $iNewTopicReply = $this->fdb->newTopic ((
int)$t[
'forum_id'], $sNewTopicSubj, $sNewTopicText,
false,
$gConf[
'robot'], $sNewTopicUri);
1297 $aNewTopicReply = $this->fdb->getPost($iNewTopicReply,
'');
1298 $aNewTopic = $this->fdb->getTopic($aNewTopicReply[
'topic_id']);
1301 $sNewTopicUrl =
$gConf[
'url'][
'base'] . sprintf(
$gConf[
'rewrite'][
'topic'], $sNewTopicUri);
1302 $sOldTopicText = sprintf(
'[L[continue_topic_last %s]]',
'<a href="' . $sNewTopicUrl .
'">' . $aNewTopic[
'topic_title'] .
'</a>');
1304 $iReplyId = $this->fdb->postReply ((
int)$t[
'forum_id'], $t[
'topic_id'], $sOldTopicText,
$gConf[
'robot']);
1307 if (!$this->fdb->isLocked($t[
'topic_id']))
1308 $this->fdb->lock($t[
'topic_id'],
$gConf[
'robot']);
1311 $a = $this->fdb->getSubscribersToTopic ($t[
'topic_id']);
1313 $this->fdb->flag($aNewTopic[
'topic_id'], $r[
'user']);
1327 $a = $this->fdb->getTopicByPostId ($post_id);
1328 $t = $this->fdb->getTopic ($a[
'topic_id']);
1329 $topic_id = $t[
'topic_uri'];
1331 $timeout =
'disabled';
1333 if ($this->
_checkUserPerm (
'', $t[
'forum_type'],
'edit', $t[
'forum_id']) )
1335 if (
'deny' == $access
1337 ($user = $this->fdb->getPostUser((
int)$post_id)) == $this->_getLoginUserName()
1339 $this->_checkUserPerm (
'',
'own',
'edit', $t[
'forum_id']) ) {
1341 $when = $this->fdb->getPostWhen ((
int)$post_id);
1342 $timeout =
$GLOBALS[
'gConf'][
'edit_timeout'] - (
time() - $when);
1343 $access = $timeout > 10 && !$t[
'topic_locked'] ?
'allow' :
'deny';
1349 if (
'allow' == $access) {
1351 $signature = $this->fdb->getSignature ($this->fdb->getPostUser((
int)$post_id));
1359 <post_id>$post_id</post_id>
1360 <topic_id>$topic_id</topic_id>
1361 <timeout>$timeout</timeout>
1362 <access>$access</access>
1363 <attachments>$files</attachments>
1364 <signature>$signature</signature>
1380 $t = $this->fdb->getTopicByUri (
filter_to_db($topic_id));
1381 $user = $this->fdb->getPostUser((
int)$post_id);
1383 if ($this->
_checkUserPerm (
'', $t[
'forum_type'],
'edit', $t[
'forum_id']))
1393 <script language=
"javascript" type=
"text/javascript">
1394 window.parent.document.f.accessDenied();
1404 $this->fdb->editPost ($post_id, $text, $user);
1411 call_user_func_array ($this->
onPostEdit, array($t, $post_id, $text, $user));
1416 <script language=
"javascript" type=
"text/javascript">
1417 if (!$isUploadSuccess)
1418 window.parent.alert (
'[L[Some or all files upload failed]]');
1419 window.parent.document.f.editSuccess(
'{$t['topic_uri
']}');
1437 $f = $this->fdb->getForumByPostId ($post_id);
1438 $aTopic = $this->fdb->getTopic ($topic_id);
1439 $sPostUser = $this->fdb->getPostUser((
int)$post_id);
1444 if ($no_access && $sPostUser ==
$sUser)
1448 if ($no_access || 0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST')) {
1452 <script language=
"javascript" type=
"text/javascript">
1453 window.parent.document.f.accessDenied();
1462 $this->fdb->deletePost ($post_id, $sPostUser ==
$sUser ?
'' :
$sUser);
1464 $exists = $this->fdb->getTopic ($topic_id) ? 1 : 0;
1467 call_user_func_array ($this->
onPostDelete, array($aTopic, $post_id, $user));
1472 <script language=
"javascript" type=
"text/javascript">
1473 window.parent.document.f.deleteSuccess(
'{$f['forum_uri
']}',
'{$aTopic['topic_uri
']}', {$exists});
1489 $f = $this->fdb->getForumByPostId((
int)$post_id);
1491 if (0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST') || !$this->
_checkUserPerm ($user,
'',
'hide_posts',
$f ?
$f[
'forum_id'] : 0))
1492 return '<ret>0</ret>';
1494 if (!$this->fdb->hidePost ((
int)$is_hide, (
int)$post_id, $user))
1495 return '<ret>0</ret>';
1497 if (is_callable($this->onPostHideUnhide))
1498 call_user_func_array ($this->onPostHideUnhide, array($is_hide, $post_id, $user));
1500 return '<ret>1</ret>';
1511 $t = $this->fdb->getTopic ($topic_id);
1514 $ac = $this->fdb->getCategs();
1515 foreach ($ac
as $c) {
1516 $s .=
'<cat name="'. htmlspecialchars($c[
'cat_name']) .
'">';
1518 $af = $this->fdb->getForumsByCatUri (
filter_to_db($c[
'cat_uri']));
1520 foreach ($af
as $f) {
1522 $s .=
'<forum id="' .
$f[
'forum_id'] .
'" uri="' .
$f[
'forum_uri'] .
'" selected="' . ($t[
'forum_id'] ==
$f[
'forum_id'] ? 1 : 0) .
'">' .
$f[
'forum_title'] .
'</forum>';
1534 <
id>{$t[
'topic_id']}</
id>
1535 <title><![CDATA[{$t[
'topic_title']}]]></title>
1536 <uri>{$t[
'topic_uri']}</uri>
1537 <forum_id>{$t[
'forum_id']}</forum_id>
1548 if (0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST') || !$this->
_checkUserPerm ($user,
'',
'move_topics', (
int)$forum_id) || !$topic_id || !$forum_id || !$old_forum_id)
1549 return '<ret>0</ret>';
1551 if (!$this->fdb->moveTopic ((
int)$topic_id, (
int)$forum_id, (
int)$old_forum_id))
1552 return '<ret>0</ret>';
1554 if (is_callable($this->onTopicMove))
1555 call_user_func_array ($this->onTopicMove, array($topic_id, $forum_id, $user));
1557 $f = $this->fdb->getForum($goto_new_location ? $forum_id : $old_forum_id);
1558 return "<ret>{$f['forum_uri']}</ret>";
1567 $f = $this->fdb->getForumByTopicId ((
int)$topic_id);
1569 if (0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST') || !$this->
_checkUserPerm ($user,
'',
'del_topics',
$f ?
$f[
'forum_id'] : 0))
1570 return '<ret>0</ret>';
1572 if (!$this->fdb->delTopic ((
int)$topic_id, $user))
1573 return '<ret>0</ret>';
1575 if (is_callable($this->onTopicDelete))
1576 call_user_func_array ($this->onTopicDelete, array($topic_id, $user));
1578 return '<ret>1</ret>';
1588 $f = $this->fdb->getForumByTopicId ((
int)$topic_id);
1590 if (0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST') || !$this->
_checkUserPerm ($user,
'', $is_hide ?
'hide_topics' :
'unhide_topics',
$f ?
$f[
'forum_id'] : 0))
1591 return '<ret>0</ret>';
1593 if (!$this->fdb->hideTopic ((
int)$is_hide, (
int)$topic_id, $user))
1594 return '<ret>0</ret>';
1596 if (is_callable($this->onTopicHideUnhide))
1597 call_user_func_array ($this->onTopicHideUnhide, array($is_hide, $topic_id, $user));
1599 return '<ret>1</ret>';
1608 $f = $this->fdb->getForumByTopicId ((
int)$topic_id);
1610 if (0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST') || !$this->
_checkUserPerm ($user,
'',
'sticky',
$f ?
$f[
'forum_id'] : 0))
1611 return '<ret>0</ret>';
1613 if (!$this->fdb->stick ((
int)$topic_id, $user))
1614 return '<ret>0</ret>';
1616 $t = $this->fdb->getTopic($topic_id);
1617 return $t[
'topic_sticky'] ?
'<ret>1</ret>' :
'<ret>-1</ret>';
1626 $f = $this->fdb->getForumByTopicId ((
int)$topic_id);
1628 if (0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST') || !$this->
_checkUserPerm ($user,
'',
'lock',
$f ?
$f[
'forum_id'] : 0))
1629 return '<ret>0</ret>';
1631 if (!$this->fdb->lock ((
int)$topic_id, $user))
1632 return '<ret>0</ret>';
1634 return $this->fdb->isLocked ((
int)$topic_id) ?
'<ret>1</ret>' :
'<ret>-1</ret>';
1643 $sAccessDeniedCode = <<<EOF
1646 <script language=
"javascript" type=
"text/javascript">
1648 if (window.parent.document.getElementById(
'tinyEditor'))
1649 window.parent.tinyMCE.execCommand(
'mceRemoveEditor',
false,
'tinyEditor');
1651 window.parent.document.f.accessDenied();
1658 $f = $this->fdb->getForum ((
int)$p[
'forum']);
1661 return $sAccessDeniedCode;
1663 if ($p[
'topic_sticky'] ==
'on' && !$this->
_checkUserPerm (
'',
'',
'sticky', (
int)$p[
'forum']))
1664 return $sAccessDeniedCode;
1675 $post_id = $this->fdb->newTopic ((
int)$p[
'forum'], $this->fdb->unescape($p[
'topic_subject']), $p[
'topic_text'], ($p[
'topic_sticky'] ==
'on'), $user, $topic_uri);
1682 call_user_func_array ($this->
onNewTopic, array((
int)$p[
'forum'], $p[
'topic_subject'], $p[
'topic_text'], ($p[
'topic_sticky'] ==
'on'), $user, $topic_uri, $post_id));
1687 <script language=
"javascript" type=
"text/javascript">
1689 if (!$isUploadSuccess)
1690 window.parent.alert (
'[L[Some or all files upload failed]]');
1692 if (window.parent.document.getElementById(
'tinyEditor'))
1693 window.parent.tinyMCE.execCommand(
'mceRemoveEditor',
false,
'tinyEditor');
1695 window.parent.document.f.selectTopic(
'{$topic_uri}');
1726 $this->fdb->updateUserActivity ($u);
1732 if (!$u)
return '<ret>0</ret>';
1734 setcookie(
'orca_pwd',
'orca_pwd',
time() - 86400);
1735 setcookie(
'orca_user',
'orca_user',
time() - 86400);
1736 setcookie(
'track_topics',
'track_topics',
time() - 86400);
1738 $this->fdb->updateUserLastActivity ($u);
1740 return '<ret>1</ret>';
1751 if (!$u || 0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST'))
1752 return '<ret>0</ret>';
1754 if (!$this->fdb->insertVote ((
int)$post_id, $u, $vote))
1755 return '<ret>0</ret>';
1757 if (is_callable($this->
onVote))
1758 call_user_func_array ($this->
onVote, array((
int)$post_id, $u, $vote));
1760 return '<ret>1</ret>';
1769 if (!$post_id || 0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST'))
1770 return '<ret>0</ret>';
1774 return '<ret>0</ret>';
1776 if (!$this->fdb->report ((
int)$post_id, $u))
1777 return '<ret>0</ret>';
1780 call_user_func_array ($this->
onReport, array((
int)$post_id, $u));
1782 return '<ret>1</ret>';
1791 if (!$topic_id || 0 !== strcasecmp($_SERVER[
'REQUEST_METHOD'],
'POST'))
1792 return '<ret>0</ret>';
1796 return '<ret>0</ret>';
1798 if ($this->fdb->isFlagged ((
int)$topic_id, $u)) {
1799 if (!$this->fdb->unflag ((
int)$topic_id, $u))
1800 return '<ret>0</ret>';
1802 call_user_func_array ($this->
onUnflag, array((
int)$topic_id, $u));
1803 return '<ret>-1</ret>';
1806 if (!$this->fdb->flag ((
int)$topic_id, $u))
1807 return '<ret>0</ret>';
1809 if (is_callable($this->
onFlag))
1810 call_user_func_array ($this->
onFlag, array((
int)$topic_id, $u));
1812 return '<ret>1</ret>';
1826 $forum_id =
$f[
'forum_id'];
1830 $a = $this->fdb->getTopics ($forum_id, 0);
1833 $lastBuildDate =
'';
1834 foreach ($a
as $r) {
1835 $lp = $this->fdb->getTopicPost($r[
'topic_id'],
'last');
1837 $td = $this->fdb->getTopicDesc ($r[
'topic_id']);
1842 if (!$lastBuildDate)
1843 $lastBuildDate = $lp[
'when'];
1845 $items .= $this->
_rssItem ($r[
'topic_title'], sprintf(
$gConf[
'rewrite'][
'topic'], $r[
'topic_uri']), $td, $lp[
'when']);
1848 return $this->
_rssFeed (
$f[
'forum_title'], sprintf(
$gConf[
'rewrite'][
'forum'],
$f[
'forum_uri'], 0),
$f[
'forum_title'], $lastBuildDate, $items);
1862 $a = $this->fdb->getRecentTopics (0);
1865 $lastBuildDate =
'';
1867 foreach ($a
as $r) {
1869 if (!isset($ui[$r[
'last_post_user']]) && ($aa = $this->
_getUserInfoReadyArray ($r[
'last_post_user'],
false)))
1870 $ui[$r[
'last_post_user']] = $aa;
1872 $td =
orca_mb_replace(
'/#/', $r[
'count_posts'],
'[L[# posts]]') .
' · ' .
orca_mb_replace(
'/#/', $ui[$r[
'last_post_user']][
'title'],
'[L[last reply by #]]') .
' · ' . $r[
'cat_name'] .
' » ' . $r[
'forum_title'];
1874 if (!$lastBuildDate)
1875 $lastBuildDate = $r[
'last_when'];
1877 $items .= $this->
_rssItem ($r[
'topic_title'], sprintf(
$gConf[
'rewrite'][
'topic'], $r[
'topic_uri']), $td, $r[
'last_when']);
1880 return $this->
_rssFeed (
'[L[Updated Topics]]',
'',
'[L[Updated Topics]]', $lastBuildDate, $items);
1894 $t = $this->fdb->getTopicByUri(
filter_to_db($topic_uri));
1895 $topic_id = (int)$t[
'topic_id'];
1898 header(
"HTTP/1.1 404 Not Found");
1899 echo
'404 Not Found';
1903 $a = $this->fdb->getPosts ($topic_id, 0,
'DESC', 10);
1906 $lastBuildDate =
'';
1907 foreach ($a
as $r) {
1910 $td = strip_tags($td);
1914 if (!$lastBuildDate) $lastBuildDate = $a[
'when'];
1916 $items .= $this->
_rssItem ($tt, sprintf(
$gConf[
'rewrite'][
'topic'], $t[
'topic_uri']), $td, $r[
'when']);
1919 return $this->
_rssFeed ($t[
'topic_title'], sprintf(
$gConf[
'rewrite'][
'topic'], $t[
'topic_uri']), $t[
'topic_title'], $lastBuildDate, $items);
1933 $a = $this->fdb->getUserPostsList(
filter_to_db($user), $sort,
$gConf[
'topics_per_page']);
1936 $lastBuildDate =
'';
1937 foreach ($a
as $r) {
1938 if (!$lastBuildDate)
1939 $lastBuildDate = $r[
'when'];
1941 $td = strip_tags($r[
'post_text']);
1942 if (strlen($td) == 256) $td .=
'[...]';
1944 $items .= $this->
_rssItem ($r[
'topic_title'], sprintf(
$gConf[
'rewrite'][
'topic'], $r[
'topic_uri']), $td, $r[
'when']);
1947 if ($sort ==
'rnd' || $sort ==
'top') $lastBuildDate =
'';
1951 $sTitle = sprintf(
"[L[%s's forum posts]]",
$aUser[
'title']);
1953 return $this->
_rssFeed (
$sTitle,
'?action=goto&search_result=1&text=&type=msgs&forum=0&u=' . $user .
'&disp=posts&start=0',
$sTitle, $lastBuildDate, $items);
1967 $a = $this->fdb->getAllPostsList($sort,
$gConf[
'topics_per_page']);
1971 $lastBuildDate =
'';
1972 foreach ($a
as $r) {
1973 if (!$lastBuildDate)
1974 $lastBuildDate = $r[
'when'];
1976 if (!isset($ui[$r[
'user']]) && ($aa = $this->
_getUserInfo ($r[
'user'])))
1977 $ui[$r[
'user']] = $aa;
1979 $td = $r[
'post_text'];
1981 $td = strip_tags($td);
1984 $items .= $this->
_rssItem ($r[
'topic_title'], sprintf(
$gConf[
'rewrite'][
'topic'], $r[
'topic_uri']), $ui[$r[
'user']][
'profile_title'] .
': ' . $td, $r[
'when']);
1987 if ($sort ==
'rnd' || $sort ==
'top') $lastBuildDate =
'';
1989 return $this->
_rssFeed (
'[L[Forum Posts]]',
'',
'[L[Forum Posts]]', $lastBuildDate, $items);
1995 $gConf[
'topics_per_page'] = 10;
2002 $sDate = date(DATE_RSS, $iTimestamp);
2007 <title><![CDATA[{$sTitle}]]></title>
2008 <link>" .
$gConf[
'url'][
'base'] . $sLink .
"</link>
2009 <description><![CDATA[{$sDesc}]]></description>
2010 <pubDate>{$sDate}</pubDate>
2011 <guid>" .
$gConf[
'url'][
'base'] . $sLink .
"</guid>
2018 if ($iLastDateTimestamp)
2019 $sLastDate = date(DATE_RSS, $iLastDateTimestamp);
2025 <title><![CDATA[{
$sTitle}]]></title>
2026 <link>{
$gConf[
'url'][
'base']}{$sLink}</link>
2027 <description><![CDATA[{
$sDesc}]]></description>
2028 <lastBuildDate>{$sLastDate}</lastBuildDate>
2045 $a[
'username'] = $u;
2046 $a[
'posts'] = (int)$as[
'posts'];
2051 $a[
'role'] = $as[
'role'];
2057 $this->
setTitle (
"<![CDATA[$u]]>");
2062 return "<root>$cu<profile>$p</profile></root>";
2072 $a[
'username'] = $user;
2082 if ($bWrapWithCdata ) {
2087 $aa[
'profile_link'] = ($aa[
'profile_url'] ?
'<a href="' . $aa[
'profile_url'] .
'">' . $aa[
'profile_title'] .
'</a>' : $aa[
'profile_title']);
2089 return array (
'avatar' => $aa[
'avatar'],
'avatar64' => $aa[
'avatar64'],
'url' => $aa[
'profile_url'],
'link' => $aa[
'profile_link'],
'title' => $aa[
'profile_title'],
'onclick' => $aa[
'profile_onclick'],
'role' => $aa[
'role']);
2095 return call_user_func_array ($this->
getUserInfo, array($user));
2108 $a = call_user_func_array ($this->
getUserPerm, array($user, $f_type, $a_type, $forum_id));
2109 return $a[
"{$a_type}_{$f_type}"];
2120 if ((
time() - $this->fdb->getPostWhen($post_id) - 10) >
$GLOBALS[
'gConf'][
'edit_timeout'])
2147 $i = round($iSec/60);
2148 if (0 == $i || 1 == $i)
$s .=
'1[L[Minute Ago]]';
2149 else $s .= $i .
'[L[Minutes Ago]]';
2150 }
else if ($iSec < 86400) {
2151 $i = round($iSec/60/60);
2152 if (0 == $i || 1 == $i)
$s .=
'1[L[Hour Ago]]';
2153 else $s .= $i .
'[L[Hours Ago]]';
2155 $i = round($iSec/60/60/24);
2156 if (0 == $i || 1 == $i)
$s .=
'1[L[Day Ago]]';
2157 else $s .= $i .
'[L[Days Ago]]';
2164 $xml =
'<forum_access>no</forum_access>';
2165 if (!$wp)
return $xml;
2172 $s = strip_tags (
$s);
2174 if (
$s ==
'')
$s =
' ';
2175 $s =
'<![CDATA[' .
$s .
']]>';
2180 if (
$GLOBALS[
'oTemplConfig']->bAllowUnicodeInPreg)
2195 $s .=
'-' . date(
'Y-m-d');
2201 for ($i = 0 ; $i < 999 ; ++$i) {
2203 return (
$s .
'-' . $i);
2207 return rand(0, 999999999);
2212 return !$this->fdb->getOne(
"SELECT 1 FROM $sTable WHERE $sField = ? LIMIT 1", [
$s]);
2217 $s = str_replace(array(
'<![CDATA[',
']]>'),
'',
$s);
2218 $GLOBALS[
'gConf'][
'title'] =
'<![CDATA[' .
$s .
'[L[add this to title]]' .
']]>';
2223 if (isset($p[
'signature']))
2224 $p[
'signature'] = trim ($p[
'signature']);
2226 if (!isset($p[
'signature']) || $p[
'signature'] == $this->fdb->getSignature ($user))
2231 return $this->fdb->updateSignature ($p[
'signature'], $user);
2240 $attachments = $this->fdb->getAttachments ($post_id);
2241 foreach ($attachments
as $file) {
2242 $mixedIndex = array_search ($file[
'att_hash'], $p[
'existing_file']);
2243 if (
false !== $mixedIndex &&
null !== $mixedIndex)
2245 $this->fdb->removeAttachment($file[
'att_hash']);
2250 $failed_uploads = 0;
2252 foreach ($_FILES[
'attachments'][
'error']
as $i => $error) {
2254 if (UPLOAD_ERR_NO_FILE == $error)
2257 if ($error != UPLOAD_ERR_OK || !$_FILES[
'attachments'][
'size'][$i]) {
2262 $tmp_name = $_FILES[
"attachments"][
"tmp_name"][$i];
2263 $name = $_FILES[
"attachments"][
"name"][$i];
2264 $type = $_FILES[
"attachments"][
"type"][$i];
2265 $size = (int)$_FILES[
"attachments"][
"size"][$i];
2266 $hash = $this->fdb->genFileHash();
2271 if (!move_uploaded_file($tmp_name,
$path .
$hash)) {
2279 if (!$this->fdb->insertAttachment ($post_id,
$hash, $name, $type, $size)) {
2286 return $failed_uploads > 0 ? 0 : 1;
2294 $a = $this->fdb->getAttachment(
$hash);
2296 header(
"HTTP/1.1 404 Not Found");
2297 echo
'404 Not Found';
2301 if (!$this->
_checkUserPerm (
'',
'',
'download', (
int)$a[
'forum_id'])) {
2306 $this->fdb->updateAttachmentDownloads (
$hash);
2308 header (
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
2309 header (
"Content-type: {$a['att_type']}");
2310 header (
"Content-Length: " . $a[
'att_size']);
2311 if (0 !== strncmp(
'image/', $a[
'att_type'], 6))
2312 header (
"Content-Disposition: attachment; filename=\"{$a['att_name']}\"");
2321 $attachments = $this->fdb->getAttachments ($post_id);
2323 foreach ($attachments
as $file) {
2325 $isImage = 0 === strncmp(
'image/', $file[
'att_type'], 6) ? 1 : 0;
2326 $files .=
'<file image="' . $isImage .
'" hash="' . $file[
'att_hash'] .
'" size="' .
orca_format_bytes($file[
'att_size']) .
'" downloads="' . $file[
'att_downloads'] .
'">' . $file[
'att_name'] .
'</file>';
2335 for ($i = 0 ; $i < $iNum ; $i +=
$iPerPage)
2337 $p .=
'<p c="' . (($iStart >= $i && $iStart < ($i +
$iPerPage)) ? 1 : 0 ).
'" start="' . $i .
'">' . ($i/
$iPerPage + 1) .
'</p>';