Example #1
0
     }
     //Если критерий поиск "по заметкам"
 } elseif ($type == 3) {
     $tpl->load_template('search/result_note.tpl');
     foreach ($sql_ as $row) {
         if ($row['user_photo']) {
             $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row['owner_user_id'] . '/50_' . $row['user_photo']);
         } else {
             $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
         }
         $tpl->set('{user-id}', $row['owner_user_id']);
         $tpl->set('{short-text}', stripslashes(strip_tags(substr($row['full_text'], 0, 200))) . '...');
         $tpl->set('{title}', stripslashes($row['title']));
         $tpl->set('{name}', $row['user_search_pref']);
         $tpl->set('{note-id}', $row['id']);
         megaDate(strtotime($row['date']), 1, 1);
         if ($row['comm_num']) {
             $tpl->set('{comm-num}', $row['comm_num'] . ' ' . gram_record($row['comm_num'], 'comments'));
         } else {
             $tpl->set('{comm-num}', $lang['note_no_comments']);
         }
         $tpl->compile('content');
     }
     //Если критерий поиск "по сообещствам"
 } elseif ($type == 4) {
     $tpl->load_template('search/result_groups.tpl');
     foreach ($sql_ as $row) {
         if ($row['com_real']) {
             $tpl->set('{real_communities}', ' <div class="search_verified" title="Подтверждённая страница"></div>');
         } else {
             $tpl->set('{real_communities}', '');
Example #2
0
             $attach_filesVX = 'Опрос';
         } else {
             $attach_filesVX = '';
         }
         $attach_filesDoc = explode('doc|', $row['attach']);
         if ($attach_filesDoc[1]) {
             $attach_filesD = 'Файл';
         } else {
             $attach_filesD = '';
         }
         $tpl->set('{attach}', $attach_filesP . $attach_filesV . $attach_filesS . $attach_filesA . $attach_filesVX . $attach_filesD);
         $tpl->set('{user-id}', $row['from_user_id']);
         $tpl->set('{name}', $row['user_search_pref']);
         $tpl->set('{mid}', $row['id']);
         OnlineTpl($row['user_last_visit']);
         megaDate($row['date'], 1, 1);
         if ($row['pm_read'] == 'no') {
             $tpl->set('[new]', '');
             $tpl->set('[/new]', '');
         } else {
             $tpl->set_block("'\\[new\\](.*?)\\[/new\\]'si", "");
         }
         $tpl->set('{folder}', 'inbox');
         $tpl->compile('content');
     }
     if ($msg_count['cnt'] > $gcount) {
         navigation($gcount, $msg_count['cnt'], '/index.php?go=messages' . $query_string . '&page=');
     }
 } else {
     msgbox('', $lang['no_msg'], 'info_2');
 }
Example #3
0
         $tpl->set('{pid}', $public_id);
         //STATUS
         if ($row['status'] and $row['fixed']) {
             $tpl->set('{status}', 'тема закреплена и закрыта');
         } else {
             if ($row['status']) {
                 $tpl->set('{status}', 'тема закрыта');
             } else {
                 if ($row['fixed']) {
                     $tpl->set('{status}', 'тема закреплена');
                 } else {
                     $tpl->set('{status}', '');
                 }
             }
         }
         megaDate($row['lastdate']);
         $tpl->compile('content');
     }
 } else {
     if (!$_POST['a']) {
         msgbox('', '<br /><br />В сообществе ещё нет тем.<br /><br /><br />', 'info_2');
     }
 }
 //Низ
 if (!$_POST['a'] and $forum_num > 20) {
     $tpl->load_template('forum/bottom.tpl');
     $tpl->set('{id}', $public_id);
     if (!$row['forum_num']) {
         $row['forum_num'] = '';
     }
     $tpl->set('{forum-num}', $row['forum_num']);
Example #4
0
     $tpl->set('{name}', $row_comments['user_search_pref']);
     if ($row_comments['user_photo']) {
         $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comments['public_id'] . '/50_' . $row_comments['user_photo']);
     } else {
         $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
     }
     $tpl->set('{comm-id}', $row_comments['id']);
     $tpl->set('{user-id}', $row_comments['public_id']);
     $expBR2 = explode('<br />', $row_comments['text']);
     $textLength2 = count($expBR2);
     $strTXT2 = strlen($row_comments['text']);
     if ($textLength2 > 6 or $strTXT2 > 470) {
         $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_comments['id'] . '" style="max-height:102px"">' . $row_comments['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_comments['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_comments['id'] . '">Показать полностью..</div>';
     }
     $tpl->set('{text}', stripslashes($row_comments['text']));
     megaDate($row_comments['add_date']);
     if (stripos($row['admin'], "u{$user_id}|") !== false or $user_id == $row_comments['public_id']) {
         $tpl->set('[owner]', '');
         $tpl->set('[/owner]', '');
     } else {
         $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
     }
     $tpl->set('[comment]', '');
     $tpl->set('[/comment]', '');
     $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
     $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", "");
     $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
     $tpl->compile('content');
 }
 //Загружаем форму ответа
 $tpl->load_template('groups/record.tpl');
Example #5
0
     $tpl->compile('info');
     if ($sql_) {
         $tpl->load_template('videos/short.tpl');
         $tpl->result['content'] .= '<span id="video_page" class="scroll_page">';
         foreach ($sql_ as $row) {
             $tpl->set('{photo}', stripslashes($row['photo']));
             $tpl->set('{title}', stripslashes($row['title']));
             $tpl->set('{user-id}', $get_user_id);
             $tpl->set('{id}', $row['id']);
             if ($row['descr']) {
                 $tpl->set('{descr}', stripslashes($row['descr']) . '...');
             } else {
                 $tpl->set('{descr}', '');
             }
             $tpl->set('{comm}', $row['comm_num'] . ' ' . gram_record($row['comm_num'], 'comments'));
             megaDate(strtotime($row['add_date']));
             if ($get_user_id == $user_id) {
                 $tpl->set('[owner]', '');
                 $tpl->set('[/owner]', '');
             } else {
                 $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
             }
             $tpl->compile('content');
         }
         $tpl->result['content'] .= '</span>';
     } else {
         msgbox('', $lang['videos_nones_videos_user'], 'info_2');
     }
 } else {
     if ($get_user_id == $user_id) {
         msgbox('', $lang['videos_nones_videos_user'], 'info_2');
    function select($public_admin, $server_time)
    {
        global $tpl, $db, $user_info, $pid;
        $user_id = $user_info['user_id'];
        $this->template;
        foreach ($this->query as $row_wall) {
            $tpl->set('{rec-id}', $row_wall['id']);
            //КНопка Показать полностью..
            $expBR = explode('<br />', $row_wall['text']);
            $textLength = count($expBR);
            $strTXT = strlen($row_wall['text']);
            if ($textLength > 9 or $strTXT > 600) {
                $row_wall['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_wall['id'] . '">' . $row_wall['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_wall['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_wall['id'] . '">Показать полностью..</div>';
            }
            //Прикрипленные файлы
            if ($row_wall['attach']) {
                $attach_arr = explode('||', $row_wall['attach']);
                $cnt_attach = 1;
                $cnt_attach_link = 1;
                $jid = 0;
                $attach_result = '';
                foreach ($attach_arr as $attach_file) {
                    $attach_type = explode('|', $attach_file);
                    //Фото со стены сообщества
                    if ($row_wall['tell_uid']) {
                        $globParId = $row_wall['tell_uid'];
                    } else {
                        $globParId = $row_wall['public_id'];
                    }
                    if ($attach_type[0] == 'photo' and file_exists(ROOT_DIR . "/uploads/groups/{$globParId}/photos/c_{$attach_type[1]}")) {
                        if ($cnt_attach < 2) {
                            $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$globParId}', '{$attach_type[1]}', '{$cnt_attach}')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/groups/{$globParId}/photos/{$attach_type[1]}\" align=\"left\" /></div>";
                        } else {
                            $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/groups/{$globParId}/photos/c_{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$globParId}', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />";
                        }
                        $cnt_attach++;
                        $resLinkTitle = '';
                        //Фото со стены юзера
                    } elseif ($attach_type[0] == 'photo_u') {
                        $attauthor_user_id = $row_wall['tell_uid'];
                        if ($attach_type[1] == 'attach' and file_exists(ROOT_DIR . "/uploads/attach/{$attauthor_user_id}/c_{$attach_type[2]}")) {
                            if ($cnt_attach < 2) {
                                $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$attauthor_user_id}', '{$attach_type[1]}', '{$cnt_attach}', 'photo_u')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/attach/{$attauthor_user_id}/{$attach_type[2]}\" align=\"left\" /></div>";
                            } else {
                                $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/attach/{$attauthor_user_id}/c_{$attach_type[2]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />";
                            }
                            $cnt_attach++;
                        } elseif (file_exists(ROOT_DIR . "/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/c_{$attach_type[1]}")) {
                            if ($cnt_attach < 2) {
                                $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$attauthor_user_id}', '{$attach_type[1]}', '{$cnt_attach}', 'photo_u')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/{$attach_type[1]}\" align=\"left\" /></div>";
                            } else {
                                $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/c_{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$row_wall['tell_uid']}', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />";
                            }
                            $cnt_attach++;
                        }
                        $resLinkTitle = '';
                        //Видео
                    } elseif ($attach_type[0] == 'video' and file_exists(ROOT_DIR . "/uploads/videos/{$attach_type[3]}/{$attach_type[1]}")) {
                        $attach_result .= "<div align=\"left\" style=\"margin-top:0px;margin-right:3px\"><a href=\"/video{$attach_type[3]}_{$attach_type[2]}\" onClick=\"videos.show({$attach_type[2]}, this.href, location.href); return false\"><img src=\"/uploads/videos/{$attach_type[3]}/{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" /></a></div>";
                        $resLinkTitle = '';
                        //Музыка
                    } elseif ($attach_type[0] == 'audio') {
                        $audioId = intval($attach_type[1]);
                        $audioInfo = $db->super_query("SELECT artist, name, url FROM `" . PREFIX . "_audio` WHERE aid = '" . $audioId . "'");
                        if ($audioInfo) {
                            $jid++;
                            $attach_result .= '<div class="audioForSize' . $row_wall['id'] . '" id="audioForSize"><div class="audio_onetrack audio_wall_onemus"><div class="audio_playic cursor_pointer fl_l" onClick="music.newStartPlay(\'' . $jid . '\', ' . $row_wall['id'] . ')" id="icPlay_' . $row_wall['id'] . $jid . '"></div><div id="music_' . $row_wall['id'] . $jid . '" data="' . $audioInfo['url'] . '" class="fl_l" style="margin-top:-1px"><a href="/?go=search&type=5&query=' . $audioInfo['artist'] . '&n=1" onClick="Page.Go(this.href); return false"><b>' . stripslashes($audioInfo['artist']) . '</b></a> &ndash; ' . stripslashes($audioInfo['name']) . '</div><div id="play_time' . $row_wall['id'] . $jid . '" class="color777 fl_r no_display" style="margin-top:2px;margin-right:5px">00:00</div><div class="player_mini_mbar fl_l no_display player_mini_mbar_wall" id="ppbarPro' . $row_wall['id'] . $jid . '"></div></div></div>';
                        }
                        $resLinkTitle = '';
                        //Смайлик
                    } elseif ($attach_type[0] == 'smile' and file_exists(ROOT_DIR . "/uploads/smiles/{$attach_type[1]}")) {
                        $attach_result .= '<img src=\\"/uploads/smiles/' . $attach_type[1] . '\\" style="margin-right:5px" />';
                        $resLinkTitle = '';
                        //Если ссылка
                    } elseif ($attach_type[0] == 'link' and preg_match('/http:\\/\\/(.*?)+$/i', $attach_type[1]) and $cnt_attach_link == 1) {
                        $count_num = count($attach_type);
                        $domain_url_name = explode('/', $attach_type[1]);
                        $rdomain_url_name = str_replace('http://', '', $domain_url_name[2]);
                        $attach_type[3] = stripslashes($attach_type[3]);
                        $attach_type[3] = substr($attach_type[3], 0, 200);
                        $attach_type[2] = stripslashes($attach_type[2]);
                        $str_title = substr($attach_type[2], 0, 55);
                        if (stripos($attach_type[4], '/uploads/attach/') === false) {
                            $attach_type[4] = '{theme}/images/no_ava_groups_100.gif';
                            $no_img = false;
                        } else {
                            $no_img = true;
                        }
                        if (!$attach_type[3]) {
                            $attach_type[3] = '';
                        }
                        if ($no_img and $attach_type[2]) {
                            if ($row_wall['tell_comm']) {
                                $no_border_link = 'border:0px';
                            }
                            $attach_result .= '<div style="margin-top:2px" class="clear"><div class="attach_link_block_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Ссылка: <a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $rdomain_url_name . '</a></div></div><div class="clear"></div><div class="wall_show_block_link" style="' . $no_border_link . '"><a href="/away.php?url=' . $attach_type[1] . '" target="_blank"><div style="width:108px;height:80px;float:left;text-align:center"><img src="' . $attach_type[4] . '" /></div></a><div class="attatch_link_title"><a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $str_title . '</a></div><div style="max-height:50px;overflow:hidden">' . $attach_type[3] . '</div></div></div>';
                            $resLinkTitle = $attach_type[2];
                            $resLinkUrl = $attach_type[1];
                        } else {
                            if ($attach_type[1] and $attach_type[2]) {
                                $attach_result .= '<div style="margin-top:2px" class="clear"><div class="attach_link_block_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Ссылка: <a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $rdomain_url_name . '</a></div></div></div><div class="clear"></div>';
                                $resLinkTitle = $attach_type[2];
                                $resLinkUrl = $attach_type[1];
                            }
                        }
                        $cnt_attach_link++;
                        //Если документ
                    } elseif ($attach_type[0] == 'doc') {
                        $doc_id = intval($attach_type[1]);
                        $row_doc = $db->super_query("SELECT dname, dsize FROM `" . PREFIX . "_doc` WHERE did = '{$doc_id}'");
                        if ($row_doc) {
                            $attach_result .= '<div style="margin-top:5px;margin-bottom:5px" class="clear"><div class="doc_attach_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Файл <a href="/index.php?go=doc&act=download&did=' . $doc_id . '" target="_blank" onMouseOver="myhtml.title(\'' . $doc_id . $cnt_attach . $row_wall['id'] . '\', \'<b>Размер файла: ' . $row_doc['dsize'] . '</b>\', \'doc_\')" id="doc_' . $doc_id . $cnt_attach . $row_wall['id'] . '">' . $row_doc['dname'] . '</a></div></div></div><div class="clear"></div>';
                            $cnt_attach++;
                        }
                        //Если опрос
                    } elseif ($attach_type[0] == 'vote') {
                        $vote_id = intval($attach_type[1]);
                        $row_vote = $db->super_query("SELECT title, answers, answer_num FROM `" . PREFIX . "_votes` WHERE id = '{$vote_id}'", false, "votes/vote_{$vote_id}");
                        if ($vote_id) {
                            $checkMyVote = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE user_id = '{$user_id}' AND vote_id = '{$vote_id}'", false, "votes/check{$user_id}_{$vote_id}");
                            $row_vote['title'] = stripslashes($row_vote['title']);
                            if (!$row_wall['text']) {
                                $row_wall['text'] = $row_vote['title'];
                            }
                            $arr_answe_list = explode('|', stripslashes($row_vote['answers']));
                            $max = $row_vote['answer_num'];
                            $sql_answer = $db->super_query("SELECT answer, COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE vote_id = '{$vote_id}' GROUP BY answer", 1, "votes/vote_answer_cnt_{$vote_id}");
                            $answer = array();
                            foreach ($sql_answer as $row_answer) {
                                $answer[$row_answer['answer']]['cnt'] = $row_answer['cnt'];
                            }
                            $attach_result .= "<div class=\"clear\" style=\"height:10px\"></div><div id=\"result_vote_block{$vote_id}\"><div class=\"wall_vote_title\">{$row_vote['title']}</div>";
                            for ($ai = 0; $ai < sizeof($arr_answe_list); $ai++) {
                                if (!$checkMyVote['cnt']) {
                                    $attach_result .= "<div class=\"wall_vote_oneanswe\" onClick=\"Votes.Send({$ai}, {$vote_id})\" id=\"wall_vote_oneanswe{$ai}\"><input type=\"radio\" name=\"answer\" /><span id=\"answer_load{$ai}\">{$arr_answe_list[$ai]}</span></div>";
                                } else {
                                    $num = $answer[$ai]['cnt'];
                                    if (!$num) {
                                        $num = 0;
                                    }
                                    if ($max != 0) {
                                        $proc = 100 * $num / $max;
                                    } else {
                                        $proc = 0;
                                    }
                                    $proc = round($proc, 2);
                                    $attach_result .= "<div class=\"wall_vote_oneanswe cursor_default\">\r\n\t\t\t\t\t\t\t\t\t{$arr_answe_list[$ai]}<br />\r\n\t\t\t\t\t\t\t\t\t<div class=\"wall_vote_proc fl_l\"><div class=\"wall_vote_proc_bg\" style=\"width:" . intval($proc) . "%\"></div><div style=\"margin-top:-16px\">{$num}</div></div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"fl_l\" style=\"margin-top:-1px\"><b>{$proc}%</b></div>\r\n\t\t\t\t\t\t\t\t\t</div><div class=\"clear\"></div>";
                                }
                            }
                            if ($row_vote['answer_num']) {
                                $answer_num_text = gram_record($row_vote['answer_num'], 'fave');
                            } else {
                                $answer_num_text = 'человек';
                            }
                            if ($row_vote['answer_num'] <= 1) {
                                $answer_text2 = 'Проголосовал';
                            } else {
                                $answer_text2 = 'Проголосовало';
                            }
                            $attach_result .= "{$answer_text2} <b>{$row_vote['answer_num']}</b> {$answer_num_text}.<div class=\"clear\" style=\"margin-top:10px\"></div></div>";
                        }
                    } else {
                        $attach_result .= '';
                    }
                }
                if ($resLinkTitle and $row_wall['text'] == $resLinkUrl or !$row_wall['text']) {
                    $row_wall['text'] = $resLinkTitle . $attach_result;
                } else {
                    if ($attach_result) {
                        $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']) . $attach_result;
                    } else {
                        $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']);
                    }
                }
            } else {
                $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']);
            }
            $resLinkTitle = '';
            //Если это запись с "рассказать друзьям"
            if ($row_wall['tell_uid']) {
                if ($row_wall['public']) {
                    $rowUserTell = $db->super_query("SELECT title, photo FROM `" . PREFIX . "_communities` WHERE id = '{$row_wall['tell_uid']}'");
                } else {
                    $rowUserTell = $db->super_query("SELECT user_search_pref, user_photo FROM `" . PREFIX . "_users` WHERE user_id = '{$row_wall['tell_uid']}'");
                }
                if (date('Y-m-d', $row_wall['tell_date']) == date('Y-m-d', $server_time)) {
                    $dateTell = langdate('сегодня в H:i', $row_wall['tell_date']);
                } elseif (date('Y-m-d', $row_wall['tell_date']) == date('Y-m-d', $server_time - 84600)) {
                    $dateTell = langdate('вчера в H:i', $row_wall['tell_date']);
                } else {
                    $dateTell = langdate('j F Y в H:i', $row_wall['tell_date']);
                }
                if ($row_wall['public']) {
                    $rowUserTell['user_search_pref'] = stripslashes($rowUserTell['title']);
                    $tell_link = 'public';
                    if ($rowUserTell['photo']) {
                        $avaTell = '/uploads/groups/' . $row_wall['tell_uid'] . '/50_' . $rowUserTell['photo'];
                    } else {
                        $avaTell = '{theme}/images/no_ava_50.png';
                    }
                } else {
                    $tell_link = 'u';
                    if ($rowUserTell['user_photo']) {
                        $avaTell = '/uploads/users/' . $row_wall['tell_uid'] . '/50_' . $rowUserTell['user_photo'];
                    } else {
                        $avaTell = '{theme}/images/no_ava_50.png';
                    }
                }
                if ($row_wall['tell_comm']) {
                    $border_tell_class = 'wall_repost_border';
                } else {
                    $border_tell_class = 'wall_repost_border2';
                }
                $row_wall['text'] = <<<HTML
{$row_wall['tell_comm']}
<div class="{$border_tell_class}">
<div class="wall_tell_info"><div class="wall_tell_ava"><a href="/{$tell_link}{$row_wall['tell_uid']}" onClick="Page.Go(this.href); return false"><img src="{$avaTell}" width="30" /></a></div><div class="wall_tell_name"><a href="/{$tell_link}{$row_wall['tell_uid']}" onClick="Page.Go(this.href); return false"><b>{$rowUserTell['user_search_pref']}</b></a></div><div class="wall_tell_date">{$dateTell}</div></div>{$row_wall['text']}
<div class="clear"></div>
</div>
HTML;
            }
            $tpl->set('{text}', stripslashes($row_wall['text']));
            $tpl->set('{name}', $row_wall['title']);
            $tpl->set('{user-id}', $row_wall['public_id']);
            if ($row_wall['adres']) {
                $tpl->set('{adres-id}', $row_wall['adres']);
            } else {
                $tpl->set('{adres-id}', 'public' . $row_wall['public_id']);
            }
            megaDate($row_wall['add_date']);
            if ($row_wall['photo']) {
                $tpl->set('{ava}', '/uploads/groups/' . $row_wall['public_id'] . '/50_' . $row_wall['photo']);
            } else {
                $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
            }
            //Мне нравится
            if (stripos($row_wall['likes_users'], "u{$user_id}|") !== false) {
                $tpl->set('{yes-like}', 'public_wall_like_yes');
                $tpl->set('{yes-like-color}', 'public_wall_like_yes_color');
                $tpl->set('{like-js-function}', 'groups.wall_remove_like(' . $row_wall['id'] . ', ' . $user_id . ')');
            } else {
                $tpl->set('{yes-like}', '');
                $tpl->set('{yes-like-color}', '');
                $tpl->set('{like-js-function}', 'groups.wall_add_like(' . $row_wall['id'] . ', ' . $user_id . ')');
            }
            if ($row_wall['likes_num']) {
                $tpl->set('{likes}', $row_wall['likes_num']);
                $tpl->set('{likes-text}', '<span id="like_text_num' . $row_wall['id'] . '">' . $row_wall['likes_num'] . '</span> ' . gram_record($row_wall['likes_num'], 'like'));
            } else {
                $tpl->set('{likes}', '');
                $tpl->set('{likes-text}', '<span id="like_text_num' . $row_wall['id'] . '">0</span> человеку');
            }
            //Выводим информцию о том кто смотрит страницу для себя
            $tpl->set('{viewer-id}', $user_id);
            if ($user_info['user_photo']) {
                $tpl->set('{viewer-ava}', '/uploads/users/' . $user_id . '/50_' . $user_info['user_photo']);
            } else {
                $tpl->set('{viewer-ava}', '{theme}/images/no_ava_50.png');
            }
            //Админ
            if ($public_admin) {
                $tpl->set('[owner]', '');
                $tpl->set('[/owner]', '');
            } else {
                $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
            }
            //Если есть комменты к записи, то выполняем след. действия / Приватность
            if ($row_wall['fasts_num']) {
                $tpl->set_block("'\\[comments-link\\](.*?)\\[/comments-link\\]'si", "");
            } else {
                $tpl->set('[comments-link]', '');
                $tpl->set('[/comments-link]', '');
            }
            //Приватность комментирования записей
            if ($row_wall['comments'] or $public_admin) {
                $tpl->set('[privacy-comment]', '');
                $tpl->set('[/privacy-comment]', '');
            } else {
                $tpl->set_block("'\\[privacy-comment\\](.*?)\\[/privacy-comment\\]'si", "");
            }
            $tpl->set('[record]', '');
            $tpl->set('[/record]', '');
            $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", "");
            $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", "");
            $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
            $tpl->compile($this->compile);
            //Если есть комменты к записи, то открываем форму ответа уже в развернутом виде и выводим комменты к записи
            if ($row_wall['comments'] or $public_admin) {
                if ($row_wall['fasts_num']) {
                    //Помещаем все комменты в id wall_fast_block_{id} это для JS
                    $tpl->result[$this->compile] .= '<div id="wall_fast_block_' . $row_wall['id'] . '" class="public_wall_rec_comments">';
                    if ($row_wall['fasts_num'] > 3) {
                        $comments_limit = $row_wall['fasts_num'] - 3;
                    } else {
                        $comments_limit = 0;
                    }
                    $sql_comments = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, public_id, text, add_date, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.public_id = tb2.user_id AND tb1.fast_comm_id = '{$row_wall['id']}' ORDER by `add_date` ASC LIMIT {$comments_limit}, 3", 1);
                    //Загружаем кнопку "Показать N запсии"
                    $tpl->set('{gram-record-all-comm}', gram_record($row_wall['fasts_num'] - 3, 'prev') . ' ' . ($row_wall['fasts_num'] - 3) . ' ' . gram_record($row_wall['fasts_num'] - 3, 'comments'));
                    if ($row_wall['fasts_num'] < 4) {
                        $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
                    } else {
                        $tpl->set('{rec-id}', $row_wall['id']);
                        $tpl->set('[all-comm]', '');
                        $tpl->set('[/all-comm]', '');
                    }
                    $tpl->set('{public-id}', $pid);
                    $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
                    $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", "");
                    $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", "");
                    $tpl->compile($this->compile);
                    //Сообственно выводим комменты
                    foreach ($sql_comments as $row_comments) {
                        $tpl->set('{public-id}', $pid);
                        $tpl->set('{name}', $row_comments['user_search_pref']);
                        if ($row_comments['user_photo']) {
                            $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comments['public_id'] . '/50_' . $row_comments['user_photo']);
                        } else {
                            $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
                        }
                        $tpl->set('{comm-id}', $row_comments['id']);
                        $tpl->set('{user-id}', $row_comments['public_id']);
                        $expBR2 = explode('<br />', $row_comments['text']);
                        $textLength2 = count($expBR2);
                        $strTXT2 = strlen($row_comments['text']);
                        if ($textLength2 > 6 or $strTXT2 > 470) {
                            $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_comments['id'] . '" style="max-height:102px"">' . $row_comments['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_comments['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_comments['id'] . '">Показать полностью..</div>';
                        }
                        $tpl->set('{text}', stripslashes($row_comments['text']));
                        megaDate($row_comments['add_date']);
                        if ($public_admin or $user_id == $row_comments['public_id']) {
                            $tpl->set('[owner]', '');
                            $tpl->set('[/owner]', '');
                        } else {
                            $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
                        }
                        $tpl->set('[comment]', '');
                        $tpl->set('[/comment]', '');
                        $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
                        $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", "");
                        $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
                        $tpl->compile($this->compile);
                    }
                    //Загружаем форму ответа
                    $tpl->set('{rec-id}', $row_wall['id']);
                    $tpl->set('{user-id}', $row_wall['public_id']);
                    $tpl->set('[comment-form]', '');
                    $tpl->set('[/comment-form]', '');
                    $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
                    $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", "");
                    $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
                    $tpl->compile($this->compile);
                    //Закрываем блок для JS
                    $tpl->result[$this->compile] .= '</div>';
                }
            }
        }
    }
Example #7
0
 function comm_select()
 {
     global $tpl, $db, $config, $user_id, $id, $for_user_id, $fast_comm_id, $record_fasts_num;
     if ($this->comm_query) {
         $this->comm_template;
         //Помещаем все комменты в id wall_fast_block_{id} это для JS
         $tpl->result[$this->compile] .= '<div id="wall_fast_block_' . $fast_comm_id . '">';
         //Загружаем кнопку "Показать N запсии" если их больше 3
         if ($record_fasts_num > 3) {
             $tpl->set('{gram-record-all-comm}', gram_record($record_fasts_num - 3, 'prev') . ' ' . ($record_fasts_num - 3) . ' ' . gram_record($record_fasts_num - 3, 'comments'));
             $tpl->set('[all-comm]', '');
             $tpl->set('[/all-comm]', '');
             $tpl->set('{rec-id}', $fast_comm_id);
             $tpl->set('{author-id}', $for_user_id);
             $tpl->set('[wall-func]', '');
             $tpl->set('[/wall-func]', '');
             $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", "");
             $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
             $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", "");
             $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", "");
             $tpl->compile($this->comm_compile);
         } else {
             $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
         }
         //Сообственно выводим комменты
         foreach ($this->comm_query as $row_comments) {
             $tpl->set('{name}', $row_comments['user_search_pref']);
             if ($row_comments['user_photo']) {
                 $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comments['author_user_id'] . '/50_' . $row_comments['user_photo']);
             } else {
                 $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
             }
             $tpl->set('{comm-id}', $row_comments['id']);
             $tpl->set('{user-id}', $row_comments['author_user_id']);
             $expBR2 = explode('<br />', $row_comments['text']);
             $textLength2 = count($expBR2);
             $strTXT2 = strlen($row_comments['text']);
             if ($textLength2 > 6 or $strTXT2 > 470) {
                 $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_comments['id'] . '" style="max-height:102px"">' . $row_comments['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_comments['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_comments['id'] . '">Показать полностью..</div>';
             }
             $tpl->set('{text}', stripslashes($row_comments['text']));
             megaDate($row_comments['add_date']);
             if (!$id) {
                 $id = $for_user_id;
             }
             if ($user_id == $row_comments['author_user_id'] || $user_id == $id) {
                 $tpl->set('[owner]', '');
                 $tpl->set('[/owner]', '');
             } else {
                 $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
             }
             $tpl->set('[comment]', '');
             $tpl->set('[/comment]', '');
             $tpl->set('[wall-func]', '');
             $tpl->set('[/wall-func]', '');
             $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", "");
             $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
             $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", "");
             $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
             $tpl->compile($this->comm_compile);
         }
         //Закрываем блок для JS
         $tpl->result[$this->compile] .= '</div>';
         //Загружаем форму ответа
         $tpl->set('{rec-id}', $fast_comm_id);
         $tpl->set('{author-id}', $for_user_id);
         $tpl->set('[comment-form]', '');
         $tpl->set('[/comment-form]', '');
         $tpl->set('[wall-func]', '');
         $tpl->set('[/wall-func]', '');
         $tpl->set_block("'\\[groups\\](.*?)\\[/groups\\]'si", "");
         $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", "");
         $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", "");
         $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", "");
         $tpl->compile($this->comm_compile);
     }
 }
Example #8
0
 $tpl->load_template('support/head.tpl');
 if ($sql_) {
     if ($user_info['user_group'] == 4) {
         $tpl->set('{cnt}', $count['cnt'] . ' ' . gram_record($count['cnt'], 'questions'));
     } else {
         $tpl->set('{cnt}', 'Вы задали ' . $count['cnt'] . ' ' . gram_record($count['cnt'], 'questions'));
     }
 } else {
     $tpl->set('{cnt}', '');
 }
 $tpl->compile('info');
 if ($sql_) {
     $tpl->load_template('support/question.tpl');
     foreach ($sql_ as $row) {
         $tpl->set('{title}', stripslashes($row['title']));
         megaDate($row['sdate']);
         if ($row['sfor_user_id'] == $row['suser_id'] or $user_info['user_group'] == 4) {
             if ($row['sfor_user_id'] == $row['suser_id']) {
                 $tpl->set('{status}', 'Вопрос ожидает обработки.');
             } else {
                 $tpl->set('{status}', 'Есть ответ.');
             }
             $tpl->set('{name}', $row['user_search_pref']);
             $tpl->set('{answer}', '');
             if ($row['user_photo']) {
                 $tpl->set('{ava}', '/uploads/users/' . $row['suser_id'] . '/50_' . $row['user_photo']);
             } else {
                 $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
             }
         } else {
             $tpl->set('{name}', 'Агент поддержки');
Example #9
0
         $cache_pref_videos = "_all";
     }
     //Если страницу смотрит другой юзер, то считаем кол-во видео
     if ($user_id != $id) {
         $video_cnt = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_videos` WHERE owner_user_id = '{$id}' {$sql_privacy}", false, "user_{$id}/videos_num{$cache_pref_videos}");
         $row['user_videos_num'] = $video_cnt['cnt'];
     }
     $sql_videos = $db->super_query("SELECT SQL_CALC_FOUND_ROWS id, title, add_date, comm_num, photo FROM `" . PREFIX . "_videos` WHERE owner_user_id = '{$id}' {$sql_privacy} ORDER by `add_date` DESC LIMIT 0,2", 1, "user_{$id}/page_videos_user{$cache_pref_videos}");
     $tpl->load_template('profile_video.tpl');
     foreach ($sql_videos as $row_videos) {
         $tpl->set('{photo}', $row_videos['photo']);
         $tpl->set('{id}', $row_videos['id']);
         $tpl->set('{user-id}', $id);
         $tpl->set('{title}', stripslashes($row_videos['title']));
         $tpl->set('{comm-num}', $row_videos['comm_num'] . ' ' . gram_record($row_videos['comm_num'], 'comments'));
         megaDate(strtotime($row_videos['add_date']), '');
         $tpl->compile('videos');
     }
 }
 //################### Подписки ###################//
 if ($row['user_subscriptions_num']) {
     $tpl->result['subscriptions'] = mozg_cache('/subscr_user_' . $id);
     if (!$tpl->result['subscriptions']) {
         $sql_subscriptions = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.friend_id, tb2.user_search_pref, user_photo, user_country_city_name, user_status FROM `" . PREFIX . "_friends` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.user_id = '{$id}' AND tb1.friend_id = tb2.user_id AND  \ttb1.subscriptions = 1 ORDER by `friends_date` DESC LIMIT 0,5", 1);
         $tpl->load_template('profile_subscription.tpl');
         foreach ($sql_subscriptions as $row_subscr) {
             $tpl->set('{user-id}', $row_subscr['friend_id']);
             $tpl->set('{name}', $row_subscr['user_search_pref']);
             if ($row_subscr['user_status']) {
                 $tpl->set('{info}', stripslashes(substr($row_subscr['user_status'], 0, 24)));
             } else {
Example #10
0
                $page_cnt = intval($_POST['page_cnt']) * $sql_limit;
            } else {
                $page_cnt = 0;
            }
            $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS did, dname, ddate, ddownload_name FROM `" . PREFIX . "_doc` WHERE duser_id = '{$user_id}' ORDER by `ddate` DESC LIMIT {$page_cnt}, {$sql_limit}", 1);
            if (!$page_cnt) {
                $rowUser = $db->super_query("SELECT user_doc_num FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'");
                $tpl->load_template('doc/top.tpl');
                $tpl->set('{doc-num}', $rowUser['user_doc_num']);
                $tpl->compile('content');
            }
            $tpl->load_template('doc/doc.tpl');
            foreach ($sql_ as $row) {
                $tpl->set('{name}', stripslashes($row['dname']));
                $tpl->set('{format}', end(explode('.', $row['ddownload_name'])));
                $tpl->set('{did}', $row['did']);
                megaDate($row['ddate']);
                $tpl->compile('content');
            }
            if (!$page_cnt and $rowUser['user_doc_num'] > 20) {
                $tpl->load_template('doc/bottom.tpl');
                $tpl->compile('content');
            }
            AjaxTpl();
            exit;
    }
    $tpl->clear();
    $db->free();
} else {
    echo 'no_log';
}
Example #11
0
         $start_limit = 0;
     }
     $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, from_user_id, text, add_date, tb2.user_search_pref, user_photo, user_last_visit FROM `" . PREFIX . "_notes_comments` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.note_id = '{$note_id}' AND tb1.from_user_id = tb2.user_id ORDER by `add_date` ASC LIMIT {$start_limit}, {$row['comm_num']}", 1);
     $tpl->load_template('notes/comment.tpl');
     foreach ($sql_ as $row_comm) {
         if ($row_comm['user_photo']) {
             $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comm['from_user_id'] . '/50_' . $row_comm['user_photo']);
         } else {
             $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
         }
         if ($row_comm['user_last_visit'] >= $online_time) {
             $tpl->set('{online}', $lang['online']);
         } else {
             $tpl->set('{online}', '');
         }
         megaDate(strtotime($row_comm['add_date']));
         if ($row_comm['from_user_id'] == $user_id || $row['owner_user_id'] == $user_id) {
             $tpl->set('[owner]', '');
             $tpl->set('[/owner]', '');
         } else {
             $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
         }
         $tpl->set('{author}', $row_comm['user_search_pref']);
         $tpl->set('{uid}', $row_comm['from_user_id']);
         $tpl->set('{id}', $row_comm['id']);
         $tpl->set('{comment}', stripslashes($row_comm['text']));
         $tpl->compile('content');
     }
 }
 //Загружаем форму добавления комментов
 $tpl->load_template('notes/addcomment.tpl');