/** * Create a new PFS folder, return new folder ID * * @param int $ownerid Owners user ID * @param string $title Folder title * @param string $desc Folder description * @param int $parentid Parent folder ID * @param boolean $ispublic Public? * @param boolean $isgallery Gallery? * @return int */ function cot_pfs_createfolder($ownerid, $title = '', $desc = '', $parentid = '', $ispublic = '', $isgallery = '') { global $db, $db_pfs_folders, $cfg, $sys, $L, $err_msg; if ($title === '') { $title = cot_import('ntitle', 'P', 'TXT'); } if ($desc === '') { $desc = cot_import('ndesc', 'P', 'TXT'); } if ($parentid === '') { $parentid = cot_import('nparentid', 'P', 'INT'); } if ($ispublic === '') { $ispublic = cot_import('nispublic', 'P', 'BOL'); } if ($isgallery === '') { $isgallery = cot_import('nisgallery', 'P', 'BOL'); } if (empty($title)) { $err_msg[] = $L['pfs_foldertitlemissing']; return 0; } $newpath = cot_translit_encode(mb_strtolower($title)); if ($parentid > 0) { $newpath = cot_pfs_folderpath($parentid, TRUE) . $newpath; $sql = $db->query("SELECT pff_id FROM {$db_pfs_folders} WHERE pff_userid=" . (int) $ownerid . " AND pff_id=" . (int) $parentid); $sql->rowCount() > 0 or cot_die(); } if ($cfg['pfs']['pfsuserfolder']) { cot_pfs_mkdir($pfs_dir_user . $newpath) or cot_redirect(cot_url('message', 'msg=500&redirect=' . base64_encode('pfs.php'), '', true)); cot_pfs_mkdir($thumbs_dir_user . $newpath) or cot_redirect(cot_url('message', 'msg=500&redirect=' . base64_encode('pfs.php'), '', true)); } $db->insert($db_pfs_folders, array('pff_parentid' => (int) $parentid, 'pff_userid' => (int) $ownerid, 'pff_title' => $title, 'pff_date' => (int) $sys['now'], 'pff_updated' => (int) $sys['now'], 'pff_desc' => $desc, 'pff_path' => $newpath, 'pff_ispublic' => (int) $ispublic, 'pff_isgallery' => (int) $isgallery, 'pff_count' => 0)); return $db->lastInsertId(); }
/** * Урл для отписки * @return string */ public function unsubscribeUrl() { $ret = cot_url('subscribe', array('m' => 'user', 'a' => 'unsubscribe', 'code' => $this->_data['unsubscr_code'])); if (!cot_url_check($ret)) { $ret = cot::$cfg['mainurl'] . '/' . $ret; } return $ret; }
function form_structure_editor($id) { global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R; $row = $cot_structure->category($id); if (empty($row)) { return null; } $ii++; $structure_id = $row['structure_id']; $structure_code = $row['structure_code']; $n = $row['structure_area']; $dozvil = $row['structure_count'] > 0 ? false : true; $is_module = cot_module_active($n); $t = new XTemplate(cot_tplfile('cateditor.admin.edit', 'plug')); $t->assign(array('ADMIN_STRUCTURE_HEADER' => $row['structure_title'], 'ADMIN_STRUCTURE_DEL_URL' => $dozvil ? cot_confirm_url(cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=delete&id=' . $row['structure_id'] . '&' . cot_xg()), 'admin') : '', 'ADMIN_STRUCTURE_UPDATE_FORM_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&id=' . $structure_id . '&a=update'), 'ADMIN_STRUCTURE_ID' => $row['structure_id'], 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', $structure_code, 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_PATHFIELDIMG' => mb_strpos($row['structure_path'], '.') == 0 ? $R['admin_icon_join1'] : $R['admin_icon_join2'], 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', $row['structure_path'], 'size="12" maxlength="255"'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', $row['structure_tpl'], 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', $row['structure_title'], 'size="32" maxlength="255"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', $row['structure_desc'], 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', $row['structure_icon'], 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox($row['structure_locked'], 'rstructurelocked'), 'ADMIN_STRUCTURE_COUNT' => $row['structure_count'], 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($cot_structure->get_parent($id), 'rstructureparent', true, 'disabled="disabled"'), 'ADMIN_STRUCTURE_JUMPTO_URL' => cot_url($n, 'c=' . $structure_code), 'ADMIN_STRUCTURE_RIGHTS_URL' => $is_module ? cot_url('admin', 'm=rightsbyitem&ic=' . $n . '&io=' . $structure_code) : '', 'ADMIN_STRUCTURE_ODDEVEN' => cot_build_oddeven($ii))); foreach ($cot_extrafields[$db_structure] as $exfld) { $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, $row['structure_' . $exfld['field_name']]); $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description']; $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title)); $t->parse('MAIN.EXTRAFLD'); } require_once cot_incfile('configuration'); $optionslist = cot_config_list($is_module ? 'module' : 'plug', $n, $structure_code); /* === Hook - Part1 : Set === */ $extp = cot_getextplugins('admin.config.edit.loop'); /* ===== */ foreach ($optionslist as $row_c) { list($title, $hint) = cot_config_titles($row_c['config_name'], $row_c['config_text']); if ($row_c['config_type'] == COT_CONFIG_TYPE_SEPARATOR) { $t->assign('ADMIN_CONFIG_FIELDSET_TITLE', $title); $t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_FIELDSET_BEGIN'); } else { $t->assign(array('ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row_c['config_name'], $row_c['config_type'], $row_c['config_value'], $row_c['config_variants']), 'ADMIN_CONFIG_ROW_CONFIG_TITLE' => $title, 'ADMIN_CONFIG_ROW_CONFIG_MORE_URL' => cot_url('admin', 'm=structure&n=' . $n . '&d=' . $durl . '&id=' . $structure_id . '&al=' . $structure_code . '&a=reset&v=' . $row_c['config_name'] . '&' . cot_xg()), 'ADMIN_CONFIG_ROW_CONFIG_MORE' => $hint)); /* === Hook - Part2 : Include === */ foreach ($extp as $pl) { include $pl; } /* ===== */ $t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_ROW_OPTION'); } $t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW'); } /* === Hook === */ foreach (cot_getextplugins('admin.config.edit.tags') as $pl) { include $pl; } /* ===== */ $t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code)); $t->parse('MAIN.CONFIG'); $t->parse('MAIN'); return $t->text('MAIN'); }
function karma_gadget($user_id, $user_karma, $location, $location_id, $module = false) { global $usr, $cfg, $karma_cache, $color; $color = explode(",", $cfg['plugin']['karma']['karma_color']); if (!$karma_cache[$user_id]) { $negative = !$cfg['plugin']['karma']['neg_rec'] && $usr['profile']['user_karma'] < 0 ? false : true; $k_add = cot_auth('plug', 'karma', 'W') && $usr['id'] > 0 && $location != 'self' ? true : ""; $karmat = new XTemplate(cot_tplfile(array('karma', 'gadget'), true)); $module = urlencode($module); $karmat->assign(array("PAGE_KARMA_D" => number_format($user_karma, '1', '.', ' '), "PAGE_KARMA_ADD" => $user_id != $usr['id'] && $k_add ? cot_url('plug', 'r=karma&act=change&lct=' . $location . '&value=add&fp=' . $location_id . '&mod=' . $module) : false, "PAGE_KARMA_DEL" => $user_id != $usr['id'] && $negative && $k_add ? cot_url('plug', 'r=karma&act=change&lct=' . $location . '&value=del&fp=' . $location_id . '&mod=' . $module) : false, "PAGE_KARMA_URL" => $k_add || $location == 'self' ? cot_url('plug', 'r=karma&act=show&fp=' . $user_id) : false, "PAGE_KARMA_MINI" => $cfg['plugin']['karma']['karma_com'] ? '' : 'karma_mini')); $karmat->parse('MAIN'); $karma_cache[$user_id] = $karmat->text('MAIN'); } return $karma_cache[$user_id]; }
function form_structure_new($parentid = '') { global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R; $t = new XTemplate(cot_tplfile('cateditor.admin.new', 'plug')); $t->assign(array('ADMIN_STRUCTURE_URL_FORM_ADD' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=add'), 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', null, 'size="16"'), 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($parentid, 'rstructureparent'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', null, 'size="64" maxlength="100"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', null, 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', null, 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox(null, 'rstructurelocked'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', null, 'size="10" maxlength="255"'))); // Extra fields foreach ($cot_extrafields[$db_structure] as $exfld) { $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, null); $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description']; $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title)); $t->parse('MAIN.EXTRAFLD'); } $t->parse('MAIN'); return $t->text('MAIN'); }
/** * Builds internationalized category path * * @param string $area Area code * @param string $cat Category code * @param string $locale Locale code * @return string */ function cot_i18n_build_catpath($area, $cat, $locale) { global $structure, $cfg, $i18n_structure; $tmp = array(); $pathcodes = explode('.', $structure[$area][$cat]['path']); foreach ($pathcodes as $k => $x) { if ($x != 'system') { if (empty($i18n_structure[$x][$locale]['title'])) { $title = $structure[$area][$x]['title']; $url = cot_url($area, 'c=' . $x); } else { $title = $i18n_structure[$x][$locale]['title']; $url = cot_url($area, 'c=' . $x . '&l=' . $locale); } $tmp[] = array($url, $title); } } return $tmp; }
function cot_get_paytop($area = '', $count = 0, $order = "s.service_id DESC") { global $db, $cfg, $sys, $db_payments_services, $db_users; $pt_cfg = cot_cfg_paytop(); if ($count == 0) { $count = $pt_cfg[$area]['count']; } if (empty($area) && !isset($pt_cfg[$area]['cost'])) { return false; } $t1 = new XTemplate(cot_tplfile(array('paytop', 'list', $area), 'plug')); $paytopcount = $db->query("SELECT COUNT(*) FROM {$db_payments_services} as s\n\t\tLEFT JOIN {$db_users} AS u ON u.user_id=s.service_userid\n\t\tWHERE u.user_id>0 AND s.service_area='paytop." . $db->prep($area) . "' AND service_expire > " . $sys['now'])->fetchColumn(); $paytops = $db->query("SELECT * FROM {$db_payments_services} as s\n\t\tLEFT JOIN {$db_users} AS u ON u.user_id=s.service_userid\n\t\tWHERE u.user_id>0 AND s.service_area='paytop." . $db->prep($area) . "' AND service_expire > " . $sys['now'] . " ORDER BY {$order} LIMIT " . $count)->fetchAll(); $jj = 0; foreach ($paytops as $tur) { $jj++; $t1->assign(cot_generate_usertags($tur, 'TOP_ROW_')); $t1->assign(array('TOP_ROW_JJ' => $jj, 'TOP_ROW_EXPIRE' => $tur['service_expire'])); $t1->parse('MAIN.TOP_ROW'); } $t1->assign(array('PAYTOP_BUY_URL' => cot_url('plug', 'e=paytop&area=' . $area), 'PAYTOP_COUNT' => $paytopcount)); $t1->parse('MAIN'); return $t1->text('MAIN'); }
function cot_sbr_sendpost($id, $text, $to, $from = 0, $type = '', $mail = false, $rfiles = array()) { global $db, $db_sbr_posts, $db_sbr, $db_sbr_files, $db_users, $sys, $cfg, $L, $R; $rpost['post_sid'] = $id; $rpost['post_text'] = $text; $rpost['post_date'] = $sys['now']; $rpost['post_from'] = $from; $rpost['post_to'] = $to; $rpost['post_type'] = $type; /* === Hook === */ foreach (cot_getextplugins('sbr.post.add.query') as $pl) { include $pl; } /* ===== */ if ($db->insert($db_sbr_posts, $rpost)) { $postid = $db->lastInsertId(); $sbr_path = $cfg['plugin']['sbr']['filepath'] . '/' . $id . '/'; if (!file_exists($sbr_path)) { mkdir($sbr_path); @chmod($sbr_path, $cfg['dir_perms']); } for ($j = 0; $j < 10; $j++) { if ($rfiles['size'][$j] > 0 && $rfiles['error'][$j] == 0) { $u_tmp_name_file = $rfiles['tmp_name'][$j]; $u_type_file = $rfiles['type'][$j]; $u_name_file = $rfiles['name'][$j]; $u_size_file = $rfiles['size'][$j]; $u_name_file = str_replace("\\'", '', $u_name_file); $u_name_file = trim(str_replace("\"", '', $u_name_file)); $dotpos = strrpos($u_name_file, ".") + 1; $f_extension = substr($u_name_file, $dotpos, 5); if (!empty($u_tmp_name_file)) { $fcheck = cot_file_check($u_tmp_name_file, $u_name_file, $f_extension); if ($fcheck == 1) { if (in_array($f_extension, explode(',', $cfg['plugin']['sbr']['extensions']))) { $u_newname_file = $postid . "_" . md5(uniqid(rand(), true)) . "." . $f_extension; $file = $sbr_path . $u_newname_file; move_uploaded_file($u_tmp_name_file, $file); @chmod($file, 0766); $rfile['file_sid'] = $id; $rfile['file_url'] = $file; $rfile['file_title'] = $u_name_file; $rfile['file_area'] = 'post'; $rfile['file_code'] = $postid; $rfile['file_ext'] = $f_extension; $rfile['file_size'] = floor($u_size_file / 1024); $db->insert($db_sbr_files, $rfile); } } } } } // Отправка сообщения на почту! if ($mail) { $sbr = $db->query("SELECT * FROM {$db_sbr} WHERE sbr_id=" . $id)->fetch(); if (!empty($to)) { $recipients[] = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $to)->fetch(); } else { $recipients[] = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $sbr['sbr_performer'])->fetch(); $recipients[] = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $sbr['sbr_employer'])->fetch(); } if (!empty($from)) { $sender = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $from)->fetch(); } foreach ($recipients as $recipient) { if (!empty($from)) { $rsubject = cot_rc($L['sbr_mail_posts_header'], array('sbr_id' => $id, 'sbr_title' => $sbr['sbr_title'])); $rbody = cot_rc($L['sbr_mail_posts_body'], array('user_name' => $recipient['user_name'], 'sender_name' => $sender['user_name'], 'post_text' => $text, 'sitename' => $cfg['maintitle'], 'link' => COT_ABSOLUTE_URL . cot_url('sbr', "id=" . $id, '', true))); } else { $rsubject = cot_rc($L['sbr_mail_notification_header'], array('sbr_id' => $id, 'sbr_title' => $sbr['sbr_title'])); $rbody = cot_rc($L['sbr_mail_notification_body'], array('user_name' => $recipient['user_name'], 'post_text' => $text, 'sitename' => $cfg['maintitle'], 'link' => COT_ABSOLUTE_URL . cot_url('sbr', "id=" . $id, '', true))); } cot_mail($recipient['user_email'], $rsubject, $rbody, '', false, null, true); } } /* === Hook === */ foreach (cot_getextplugins('sbr.post.add.done') as $pl) { include $pl; } /* ===== */ return $db->lastInsertId(); } return false; }
/* ===== */ $t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code)); $t->parse('MAIN.OPTIONS.CONFIG'); } $t->parse($id || !empty($al) ? 'MAIN.OPTIONS' : 'MAIN.DEFAULT.ROW'); } if (!$id && empty($al)) { $t->assign(array('ADMIN_STRUCTURE_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_STRUCTURE_PAGNAV' => $pagenav['main'], 'ADMIN_STRUCTURE_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_STRUCTURE_TOTALITEMS' => $totalitems, 'ADMIN_STRUCTURE_COUNTER_ROW' => $ii)); $t->parse('MAIN.DEFAULT'); // flush post buffer if it contains Update Table data $uri = str_replace('&_ajax=1', '', $_SERVER['REQUEST_URI']); $hash = md5($uri); if (is_array($_SESSION['cot_buffer'][$hash]['rstructurecode'])) { unset($_SESSION['cot_buffer'][$hash]); } $t->assign(array('ADMIN_STRUCTURE_URL_FORM_ADD' => cot_url('admin', 'm=structure&n=' . $n . '&mode=' . $mode . '&a=add&d=' . $durl), 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', null, 'size="16"'), 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', null, 'size="16" maxlength="16"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', null, 'size="64" maxlength="100"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', null, 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', null, 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox(null, 'rstructurelocked'), 'ADMIN_STRUCTURE_TPLMODE' => cot_radiobox(null, 'rtplmode', array('1', '2', '3'), array($L['adm_tpl_empty'], $L['adm_tpl_parent'], $L['adm_tpl_forced']), '', '<br />'))); // Extra fields foreach ($cot_extrafields[$db_structure] as $exfld) { $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, null); $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description']; $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title)); $t->parse('MAIN.NEWCAT.EXTRAFLD'); } $t->parse('MAIN.NEWCAT'); } cot_display_messages($t); /* === Hook === */ foreach (cot_getextplugins('admin.structure.tags') as $pl) { include $pl; } /* ===== */
<?php /** * [BEGIN_COT_EXT] * Hooks=users.register.add.validate * [END_COT_EXT] */ /** * plugin User Group Selector for Cotonti Siena * * @package usergroupselector * @version 1.0.0 * @author CMSWorks Team * @copyright Copyright (c) CMSWorks.ru, littledev.ru * @license BSD * */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_langfile('usergroupselector', 'plug'); $usergroup = cot_import('usergroup', 'G', 'ALP'); if (cot_error_found() && !empty($usergroup)) { cot_redirect(cot_url('users', 'm=register&usergroup=' . $usergroup, '', true)); }
foreach (cot_getextplugins('market.list.query') as $pl) { include $pl; } /* ===== */ $t = new XTemplate($mskin); $where = $where ? 'WHERE ' . implode(' AND ', $where) : ''; $order = $order ? 'ORDER BY ' . implode(', ', $order) : ''; $totalitems = $db->query("SELECT COUNT(*) FROM {$db_market} AS m {$join_condition} \n\tLEFT JOIN {$db_users} AS u ON u.user_id=m.item_userid\n\t" . $where . "")->fetchColumn(); $sqllist = $db->query("SELECT m.*, u.* {$join_columns} \n\tFROM {$db_market} AS m {$join_condition}\n\tLEFT JOIN {$db_users} AS u ON u.user_id=m.item_userid \n\t" . $where . "\n\t" . $order . "\n\tLIMIT {$d}, " . $maxrowsperpage); $pagenav = cot_pagenav('market', $list_url_path, $d, $totalitems, $maxrowsperpage); $catpatharray[] = array(cot_url('market'), $L['market']); if (!empty($c)) { $catpatharray = array_merge($catpatharray, cot_structure_buildpath('market', $c)); } $catpath = cot_breadcrumbs($catpatharray, $cfg['homebreadcrumb'], true); $t->assign(array("SEARCH_ACTION_URL" => cot_url('market', '', '', true), "SEARCH_SQ" => cot_inputbox('text', 'sq', htmlspecialchars($sq), 'class="schstring"'), "SEARCH_CAT" => cot_market_selectcat($c, 'c'), "SEARCH_SORTER" => cot_selectbox($sort, "sort", array('', 'costasc', 'costdesc'), array($L['market_mostrelevant'], $L['market_costasc'], $L['market_costdesc']), false), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "PAGENAV_COUNT" => $totalitems, "CATALOG" => cot_build_structure_market_tree('', array($c), 0), "BREADCRUMBS" => $catpath, "CATTITLE" => !empty($c) ? $structure['market'][$c]['title'] : '', "CATDESC" => !empty($c) ? $structure['market'][$c]['desc'] : '')); foreach ($cot_extrafields[$db_market] as $exfld) { $uname = strtoupper($exfld['field_name']); $exfld_val = cot_build_extrafields($exfld['field_name'], $exfld, $shfld[$exfld['field_name']]); $exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description']; $t->assign(array('SEARCH_' . $uname => $exfld_val, 'SEARCH_' . $uname . '_TITLE' => $exfld_title)); } /* === Hook === */ foreach (cot_getextplugins('market.list.search.tags') as $pl) { include $pl; } /* ===== */ $sqllist_rowset = $sqllist->fetchAll(); $sqllist_idset = array(); foreach ($sqllist_rowset as $item) { $sqllist_idset[$item['item_id']] = $item['item_alias'];
* @author CMSWorks Team * @copyright Copyright (c) CMSWorks.ru, littledev.ru * @license BSD * */ defined('COT_CODE') or die('Wrong URL.'); if ($cfg['plugin']['tagslance']['projects']) { require_once cot_incfile('tags', 'plug'); if (cot_plugin_active('i18n') && $i18n_enabled && $i18n_notmain) { $tags_extra = array('tag_locale' => $i18n_locale); } else { $tags_extra = null; } $item_id = $item['item_id']; if (!isset($tags_rowset_list)) { $tags_rowset_list = cot_tag_list(array_keys($sqllist_idset), 'projects', $tags_extra); } $tags = isset($tags_rowset_list[$item_id]) ? $tags_rowset_list[$item_id] : array(); if (count($tags) > 0) { $tag_i = 0; foreach ($tags as $tag) { $tag_u = $cfg['plugin']['tags']['translit'] ? cot_translit_encode($tag) : $tag; $tl = $lang != 'en' && $tag_u != $tag ? 1 : null; $t_pr->assign(array('PRJ_ROW_TAGS_ROW_TAG' => $cfg['plugin']['tags']['title'] ? htmlspecialchars(cot_tag_title($tag)) : htmlspecialchars($tag), 'PRJ_ROW_TAGS_ROW_URL' => cot_url('plug', array('e' => 'tags', 'a' => 'projects', 't' => str_replace(' ', '-', $tag_u), 'tl' => $tl)))); $t_pr->parse('PROJECTS.PRJ_ROWS.PRJ_ROW_TAGS_ROW'); $tag_i++; } } else { $t_pr->assign(array('PRJ_ROW_NO_TAGS' => $L['tags_Tag_cloud_none'])); $t_pr->parse('PROJECTS.PRJ_ROWS.PRJ_ROW_NO_TAGS'); } }
if (empty($ritem['item_type']) && !empty($type)) { $ritem['item_type'] = $type; } $out['subtitle'] = $L['projects_add_project_title']; $out['head'] .= $R['code_noindex']; $sys['sublocation'] = $structure['projects'][$c]['title']; $mskin = cot_tplfile(array('projects', 'add', $structure['projects'][$ritem['item_cat']]['tpl'])); /* === Hook === */ foreach (cot_getextplugins('projects.add.main') as $pl) { include $pl; } /* ===== */ $t = new XTemplate($mskin); // Error and message handling cot_display_messages($t); $t->assign(array("PRJADD_FORM_SEND" => cot_url('projects', 'm=add&c=' . $c . '&type=' . $type . '&a=add'), "PRJADD_FORM_CAT" => cot_selectbox_structure('projects', $ritem['item_cat'], 'rcat'), "PRJADD_FORM_CATTITLE" => !empty($c) ? $structure['projects'][$c]['title'] : '', "PRJADD_FORM_TYPE" => is_array($projects_types) ? cot_selectbox($ritem['item_type'] ? $ritem['item_type'] : $cfg['projects']['default_type'], 'rtype', array_keys($projects_types), array_values($projects_types)) : 'empty', "PRJADD_FORM_TYPETITLE" => is_array($projects_types) && !empty($type) ? $projects_types[$type] : '', "PRJADD_FORM_TITLE" => cot_inputbox('text', 'rtitle', $ritem['item_title'], 'size="56"'), "PRJADD_FORM_ALIAS" => cot_inputbox('text', 'ralias', $ritem['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRJADD_FORM_TEXT" => cot_textarea('rtext', $ritem['item_text'], 10, 60, 'id="formtext"', $prjeditor ? 'input_textarea_' . $prjeditor : ''), "PRJADD_FORM_COST" => cot_inputbox('text', 'rcost', $ritem['item_cost'], 'size="10"'), "PRJADD_FORM_PARSER" => cot_selectbox($cfg['projects']['parser'], 'rparser', $parser_list, $parser_list, false))); // Extra fields foreach ($cot_extrafields[$db_projects] as $exfld) { $uname = strtoupper($exfld['field_name']); $exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $ritem['item_' . $exfld['field_name']]); $exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description']; $t->assign(array('PRJADD_FORM_' . $uname => $exfld_val, 'PRJADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRJADD_FORM_EXTRAFLD' => $exfld_val, 'PRJADD_FORM_EXTRAFLD_TITLE' => $exfld_title)); $t->parse('MAIN.EXTRAFLD'); } /* === Hook === */ foreach (cot_getextplugins('projects.add.tags') as $pl) { include $pl; } /* ===== */ $t->parse('MAIN'); $module_body = $t->text('MAIN');
<?php /** * Administration panel - PHP Infos * * @package Cotonti * @copyright (c) Cotonti Team * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt */ defined('COT_CODE') && defined('COT_ADMIN') or die('Wrong URL.'); list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('admin', 'a'); cot_block($usr['auth_read']); $t = new XTemplate(cot_tplfile('admin.infos', 'core')); $adminpath[] = array(cot_url('admin', 'm=other'), $L['Other']); $adminpath[] = array(cot_url('admin', 'm=infos'), $L['adm_infos']); $adminhelp = $L['adm_help_versions']; $adminsubtitle = $L['adm_infos']; /* === Hook === */ foreach (cot_getextplugins('admin.infos.first') as $pl) { include $pl; } /* ===== */ @error_reporting(0); $t->assign(array('ADMIN_INFOS_PHPVER' => function_exists('phpversion') ? phpversion() : $L['adm_help_config'], 'ADMIN_INFOS_ZENDVER' => function_exists('zend_version') ? zend_version() : $L['adm_help_config'], 'ADMIN_INFOS_INTERFACE' => function_exists('php_sapi_name') ? php_sapi_name() : $L['adm_help_config'], 'ADMIN_INFOS_CACHEDRIVERS' => is_array($cot_cache_drivers) ? implode(', ', $cot_cache_drivers) : '', 'ADMIN_INFOS_OS' => function_exists('php_uname') ? php_uname() : $L['adm_help_config'], 'ADMIN_INFOS_DATE' => cot_date('datetime_medium', $sys['now'], false), 'ADMIN_INFOS_GMDATE' => gmdate('Y-m-d H:i'), 'ADMIN_INFOS_GMTTIME' => $usr['gmttime'], 'ADMIN_INFOS_USRTIME' => $usr['localtime'], 'ADMIN_INFOS_TIMETEXT' => $usr['timetext'])); /* === Hook === */ foreach (cot_getextplugins('admin.infos.tags') as $pl) { include $pl; } /* ===== */ $t->parse('MAIN'); $adminmain = $t->text('MAIN');
include $pl; } /* ===== */ $out['head'] .= $R['code_noindex']; $out['subtitle'] = $title; require_once $cfg['system_dir'] . '/header.php'; $tpl_type = defined('COT_ADMIN') ? 'core' : 'module'; $t = new XTemplate(cot_tplfile('message', $tpl_type)); if (COT_AJAX) { $t->assign('AJAX_MODE', true); } $errmsg = $title; $title .= $usr['isadmin'] ? ' (#' . $msg . ')' : ''; $t->assign('MESSAGE_TITLE', $title); $t->assign('MESSAGE_BODY', $body); if ($msg == '920') { $confirm_no_url = preg_match("/^.+" . preg_quote($sys['domain'] . "/"), $_SERVER['HTTP_REFERER']) ? str_replace('&', '&', $_SERVER['HTTP_REFERER']) : cot_url('index'); if (preg_match('#[ "\':]#', base64_decode($redirect))) { $redirect = ''; } $t->assign(array('MESSAGE_CONFIRM_YES' => base64_decode($redirect), 'MESSAGE_CONFIRM_NO' => $confirm_no_url)); $t->parse('MAIN.MESSAGE_CONFIRM'); } /* === Hook === */ foreach (cot_getextplugins('message.tags') as $pl) { include $pl; } /* ===== */ $t->parse('MAIN'); $t->out('MAIN'); require_once $cfg['system_dir'] . '/footer.php';
* pagecattree Plugin for Cotonti CMF * * @version 2.0.0 * @author esclkm, http://www.littledev.ru * @copyright (c) 2008-2011 esclkm, http://www.littledev.ru */ defined('COT_CODE') or die('Wrong URL.'); $adminpath[] = array(cot_url('admin', 'm=structure'), $L['Structure']); // Show available module list if (is_array($extension_structure) && count($extension_structure) > 0) { foreach ($extension_structure as $code) { $parse = false; if (cot_plugin_active($code)) { $is_module = false; $parse = true; } if (cot_module_active($code)) { $is_module = true; $parse = true; } if ($parse) { $ext_info = cot_get_extensionparams($code, $is_module); $t->assign(array('ADMIN_STRUCTURE_EXT_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $code), 'ADMIN_STRUCTURE_EXT_ICO' => $ext_info['icon'], 'ADMIN_STRUCTURE_EXT_NAME' => $ext_info['name'])); $t->parse('MAIN.ADMIN_STRUCTURE_EXT'); } } } else { $t->parse('MAIN.ADMIN_STRUCTURE_EMPTY'); } $t->assign(array('ADMIN_STRUCTURE_EXFLDS_URL' => cot_url('admin', 'm=extrafields')));
cot_log("Attempt to directly access an un-validated", 'sec'); cot_redirect(cot_url('message', "msg=930", '', true)); exit; } if ($usr['id'] != $item['item_userid'] && (!$usr['isadmin'] || $cfg['folio']['count_admin'])) { $item['item_count']++; $db->update($db_folio, array('item_count' => $item['item_count']), "item_id=" . (int) $item['item_id']); } $title_params = array('TITLE' => empty($item['item_metatitle']) ? $item['item_title'] : $item['item_metatitle'], 'CATEGORY' => $structure['folio'][$item['item_cat']]['title']); $out['subtitle'] = cot_title($cfg['folio']['title_folio'], $title_params); $out['desc'] = !empty($item['item_metadesc']) ? $item['item_metadesc'] : cot_cutstring(strip_tags(cot_parse($item['item_text'], $cfg['folio']['markup'], $item['item_parser'])), 160); $out['meta_keywords'] = !empty($item['item_keywords']) ? $item['item_keywords'] : $structure['folio'][$item['item_cat']]['keywords']; // Building the canonical URL $pageurl_params = array('c' => $item['item_cat']); empty($al) ? $pageurl_params['id'] = $id : ($pageurl_params['al'] = $al); $out['canonical_uri'] = cot_url('folio', $pageurl_params); $mskin = cot_tplfile(array('folio', $structure['folio'][$item['item_cat']]['tpl'])); /* === Hook === */ foreach (cot_getextplugins('folio.main') as $pl) { include $pl; } /* ===== */ $t = new XTemplate($mskin); $t->assign(cot_generate_usertags($item, 'PRD_OWNER_')); $t->assign(cot_generate_foliotags($item, 'PRD_', $cfg['folio']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb'])); /* === Hook === */ foreach (cot_getextplugins('folio.tags') as $pl) { include $pl; } /* ===== */ if ($usr['isadmin']) {
foreach (cot_getextplugins('projects.preview.save.done') as $pl) { include $pl; } /* ===== */ cot_redirect($r_url); exit; } $out['subtitle'] = $L['projects']; $mskin = cot_tplfile(array('projects', 'preview', $structure['projects'][$item['item_cat']]['tpl'])); /* === Hook === */ foreach (cot_getextplugins('projects.preview.main') as $pl) { include $pl; } /* ===== */ $t = new XTemplate($mskin); if ($item['item_state'] != 0 && !$usr['isadmin'] && $usr['id'] != $item['item_userid']) { cot_log("Attempt to directly access an un-validated", 'sec'); cot_redirect(cot_url('message', "msg=930", '', true)); exit; } $r_url = empty($item['item_alias']) ? cot_url('projects', 'c=' . $item['item_cat'] . '&id=' . $id) : cot_url('projects', 'c=' . $item['item_cat'] . '&al=' . $item['item_alias']); $t->assign(cot_generate_usertags($item, 'PRJ_OWNER_')); $t->assign(cot_generate_projecttags($item, 'PRJ_', $cfg['projects']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb'])); $t->assign(array("PRJ_SHOW_URL" => $cfg['mainurl'] . '/' . $r_url, "PRJ_SAVE_URL" => cot_url('projects', 'm=preview&a=save&id=' . $item['item_id'] . '&' . cot_xg()), "PRJ_EDIT_URL" => cot_url('projects', 'm=edit&id=' . $item['item_id']))); /* === Hook === */ foreach (cot_getextplugins('projects.preview.tags') as $pl) { include $pl; } /* ===== */ $t->parse('MAIN'); $module_body = $t->text('MAIN');
/** * Generates Poll form * * @param int $id Poll ID or Poll Code if $type is not epmty * @param string $formlink Poll form url * @param string $theme Poll template name * @param string $type Poll type * @return array * @global CotDB $db */ function cot_poll_form($id, $formlink = '', $theme = '', $type = '') { global $db, $cfg, $db_polls, $db_polls_options, $db_polls_voters, $usr; $canvote = false; if (!is_array($id)) { $id = (int) $id; $where = !$type ? "poll_id = {$id}" : "poll_type = '" . $db->prep($type) . "' AND poll_code = '{$id}'"; $sql = $db->query("SELECT * FROM {$db_polls} WHERE {$where} LIMIT 1"); if (!($row = $sql->fetch())) { return false; } } else { $row = $id; } $id = $row['poll_id']; $alreadyvoted = 0; if ($cfg['polls']['ip_id_polls'] == 'id' && $usr['id'] > 0) { $where = "pv_userid = '" . $usr['id'] . "'"; $canvote = true; } else { $where = $usr['id'] > 0 ? "(pv_userid = '" . $usr['id'] . "' OR pv_userip = '" . $usr['ip'] . "')" : "pv_userip = '" . $usr['ip'] . "'"; $canvote = true; } $sql2 = $db->query("SELECT pv_id FROM {$db_polls_voters} WHERE pv_pollid = {$id} AND {$where} LIMIT 1"); $alreadyvoted = $sql2->rowCount() == 1 ? 1 : 0; $themefile = cot_tplfile(array('polls', $theme), 'module'); $t = new XTemplate($themefile); if ($alreadyvoted) { $poll_block = 'POLL_VIEW_VOTED'; } elseif (!$canvote) { $poll_block = 'POLL_VIEW_DISABLED'; } elseif ($row['poll_state']) { $poll_block = 'POLL_VIEW_LOCKED'; } else { $poll_block = 'POLL_VIEW'; } $sql2 = $db->query("SELECT SUM(po_count) FROM {$db_polls_options} WHERE po_pollid = {$id}"); $totalvotes = $sql2->fetchColumn(); $sql1 = $db->query("SELECT po_id, po_text, po_count FROM {$db_polls_options} WHERE po_pollid = {$id} ORDER by po_id ASC"); while ($row1 = $sql1->fetch()) { $po_id = $row1['po_id']; $po_count = $row1['po_count']; $percent = @round(100 * ($po_count / $totalvotes), 1); $input_type = $row['poll_multiple'] ? 'checkbox' : 'radio'; $polloptions_input = $alreadyvoted || !$canvote ? "" : '<input type="' . $input_type . '" name="vote[]" value="' . $po_id . '" /> '; // TODO - to resorses $polloptions = cot_parse($row1['po_text'], $cfg['polls']['markup']); $t->assign(array('POLL_OPTIONS' => $polloptions, 'POLL_PER' => $percent, 'POLL_COUNT' => $po_count, 'POLL_INPUT' => $polloptions_input)); $t->parse($poll_block . ".POLLTABLE"); } $sql1->closeCursor(); $t->assign(array('POLL_VOTERS' => $totalvotes, 'POLL_SINCE' => cot_date('datetime_medium', $row['poll_creationdate']), 'POLL_SINCE_STAMP' => $row['poll_creationdate'], 'POLL_SINCE_SHORT' => cot_date('date_short', $row['poll_creationdate']), 'POLL_TITLE' => cot_parse($row['poll_text'], $cfg['polls']['markup']), 'POLL_ID' => $id, 'POLL_FORM_URL' => empty($formlink) ? cot_url('polls', 'id=' . $id) : $formlink, 'POLL_FORM_BUTTON' => $pollbutton)); $t->parse($poll_block); $row['poll_alreadyvoted'] = $alreadyvoted; $row['poll_count'] = $totalvotes; $row['poll_block'] = $t->text($poll_block); return $row; }
} $sqllist = $db->query("SELECT SQL_CALC_FOUND_ROWS p.* {$search_join_columns}\n\t\tFROM {$db_projects} AS p {$search_join_condition}\n\t\tWHERE {$where}\n\t\tORDER BY item_" . $rs['prjsort'] . " " . $rs['prjsort2'] . "\n\t\tLIMIT {$d}, " . $cfg_maxitems . $search_union_query); $items = $sql->rowCount(); $totalitems[] = $db->query('SELECT FOUND_ROWS()')->fetchColumn(); $jj = 0; $sqllist_rowset = $sqllist->fetchAll(); $sqllist_idset = array(); foreach ($sqllist_rowset as $item) { $sqllist_idset[$item['item_id']] = $item['item_alias']; } /* === Hook - Part 1 === */ $extp = cot_getextplugins('projects.search.loop'); /* ===== */ foreach ($sqllist_rowset as $row) { $url_cat = cot_url('projects', 'c=' . $row['item_cat']); $url_prj = empty($row['item_alias']) ? cot_url('projects', 'c=' . $row['item_cat'] . '&id=' . $row['item_id'] . '&highlight=' . $hl) : cot_url('projects', 'c=' . $row['item_cat'] . '&al=' . $row['item_alias'] . '&highlight=' . $hl); $t->assign(cot_generate_projecttags($row, 'PLUGIN_PROJECTSRES_')); $t->assign(array('PLUGIN_PROJECTSRES_CATEGORY' => cot_rc_link($url_cat, $structure['projects'][$row['item_cat']]['tpath']), 'PLUGIN_PROJECTSRES_CATEGORY_URL' => $url_cat, 'PLUGIN_PROJECTSRES_TITLE' => cot_rc_link($url_prj, htmlspecialchars($row['item_title'])), 'PLUGIN_PROJECTSRES_TEXT' => cot_clear_mark($row['item_text'], $words), 'PLUGIN_PROJECTSRES_TIME' => cot_date('datetime_medium', $row['item_date']), 'PLUGIN_PROJECTSRES_TIMESTAMP' => $row['item_date'], 'PLUGIN_PROJECTSRES_ODDEVEN' => cot_build_oddeven($jj), 'PLUGIN_PROJECTSRES_NUM' => $jj)); /* === Hook - Part 2 === */ foreach ($extp as $pl) { include $pl; } /* ===== */ $t->parse('MAIN.RESULTS.PROJECTS.ITEM'); $jj++; } if ($jj > 0) { $t->parse('MAIN.RESULTS.PROJECTS'); } unset($where_and, $where_or, $where); }
<?php /* ==================== [BEGIN_COT_EXT] Hooks=header.tags [END_COT_EXT] ==================== */ /** * Subscribe module for Cotonti Siena * * @package Subscribe * @author Kalnov Alexey <*****@*****.**> * @copyright Portal30 Studio http://portal30.ru */ defined('COT_CODE') or die('Wrong URL.'); if (!COT_AJAX && defined('COT_ADMIN') && $cfg['admintheme'] == 'cpanel') { $admin_MenuUser['subscribe'] = array('title' => cot::$L['subscribe_my'], 'url' => cot_url('subscribe', array('m' => 'user')), 'icon_class' => 'fa fa-envelope'); }
/* === Hook - Part4 : Include === */ foreach ($extp4 as $pl) { include $pl; } /* ===== */ $t_o->parse("MAIN.ROWS"); } $addoffer_enabled = true; /* === Hook === */ foreach (cot_getextplugins('projects.addofferform.main') as $pl) { include $pl; } /* ===== */ $sql = $db->query("SELECT * FROM {$db_projects_offers} WHERE offer_pid=" . $id . " AND offer_userid=" . $usr['id'] . ""); if ($sql->fetchColumn() == 0 && $addoffer_enabled && $usr['auth_offers'] && $usr['id'] != $item['item_userid'] && empty($performer)) { $t_o->assign(array("OFFER_FORM_COSTMIN" => cot_inputbox('text', 'costmin', $roffer['offer_cost_min'], 'size="7"'), "OFFER_FORM_COSTMAX" => cot_inputbox('text', 'costmax', $roffer['offer_cost_max'], 'size="7"'), "OFFER_FORM_TIMEMIN" => cot_inputbox('text', 'timemin', $roffer['offer_time_min'], 'size="7"'), "OFFER_FORM_TIMEMAX" => cot_inputbox('text', 'timemax', $roffer['offer_time_max'], 'size="7"'), "OFFER_FORM_TEXT" => cot_textarea('offertext', $roffer['offer_text'], 7, 40), "OFFER_FORM_HIDDEN" => cot_checkbox(0, 'hidden', $L['offers_hide_offer']), "OFFER_FORM_ACTION_URL" => cot_url('projects', 'id=' . $id . '&a=addoffer'), "OFFER_FORM_TIMETYPE" => cot_selectbox($timetype, 'timetype', array_keys($L['offers_timetype']), array_values($L['offers_timetype']), false))); // Extra fields foreach ($cot_extrafields[$db_projects_offers] as $exfld) { $uname = strtoupper($exfld['field_name']); $exfld_val = cot_build_extrafields('roffer' . $exfld['field_name'], $exfld, $roffer['offer_' . $exfld['field_name']]); $exfld_title = isset($L['offers_' . $exfld['field_name'] . '_title']) ? $L['offers_' . $exfld['field_name'] . '_title'] : $exfld['field_description']; $t_o->assign(array('OFFER_FORM_' . $uname => $exfld_val, 'OFFER_FORM_' . $uname . '_TITLE' => $exfld_title, 'OFFER_FORM_EXTRAFLD' => $exfld_val, 'OFFER_FORM_EXTRAFLD_TITLE' => $exfld_title)); $t_o->parse('MAIN.EXTRAFLD'); } /* === Hook === */ foreach (cot_getextplugins('projects.addofferform.tags') as $pl) { include $pl; } /* ===== */ $t_o->parse("MAIN.ADDOFFERFORM"); }
$enabled = 1; break; } $tr_t->assign(array('ADMIN_TRASHCAN_DATE' => cot_date('datetime_medium', $row['tr_date']), 'ADMIN_TRASHCAN_DATE_STAMP' => $row['tr_date'], 'ADMIN_TRASHCAN_TYPESTR_ICON' => $icon, 'ADMIN_TRASHCAN_TYPESTR' => $typestr, 'ADMIN_TRASHCAN_TITLE' => htmlspecialchars($row['tr_title']), 'ADMIN_TRASHCAN_TRASHEDBY' => $row['tr_trashedby'] == 0 ? $L['System'] : cot_build_user($row['tr_trashedby'], htmlspecialchars($row['user_name'])), 'ADMIN_TRASHCAN_ROW_WIPE_URL' => cot_url('admin', 'm=other&p=trashcan&a=wipe&id=' . $row['tr_id'] . '&d=' . $durl . '&' . cot_xg()), 'ADMIN_TRASHCAN_ROW_RESTORE_URL' => cot_url('admin', 'm=other&p=trashcan&a=restore&id=' . $row['tr_id'] . '&d=' . $durl . '&' . cot_xg()), 'ADMIN_TRASHCAN_ROW_INFO_URL' => cot_url('admin', 'm=other&p=trashcan&a=info&id=' . $row['tr_id']), 'ADMIN_TRASHCAN_ROW_RESTORE_ENABLED' => $enabled)); /* === Hook - Part2 : Include === */ foreach ($extp as $pl) { include $pl; } /* ===== */ if ($info) { $adminpath[] = array(cot_url('admin', 'm=other&p=trashcan&a=info&id=' . $id), $row['tr_title']); $data = unserialize($row['tr_datas']); foreach ($data as $key => $val) { $tr_t->assign(array('ADMIN_TRASHCAN_INFO_ROW' => htmlspecialchars($key), 'ADMIN_TRASHCAN_INFO_VALUE' => $val)); $tr_t->parse('MAIN.TRASHCAN_ROW.TRASHCAN_INFOROW'); } } $tr_t->parse('MAIN.TRASHCAN_ROW'); } if ($ii == 0) { $tr_t->parse('MAIN.TRASHCAN_EMPTY'); } $tr_t->assign(array('ADMIN_TRASHCAN_CONF_URL' => cot_url('admin', 'm=config&n=edit&o=plug&p=trashcan'), 'ADMIN_TRASHCAN_WIPEALL_URL' => cot_url('admin', 'm=other&p=trashcan&a=wipeall&' . cot_xg()), 'ADMIN_TRASHCAN_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_TRASHCAN_PAGNAV' => $pagenav['main'], 'ADMIN_TRASHCAN_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_TRASHCAN_TOTALITEMS' => $totalitems, 'ADMIN_TRASHCAN_COUNTER_ROW' => $ii, 'ADMIN_TRASHCAN_PAGESQUEUED' => $pagesqueued)); cot_display_messages($tr_t); /* === Hook === */ foreach (cot_getextplugins('trashcan.admin.tags') as $pl) { include $pl; } /* ===== */ $tr_t->parse('MAIN'); $plugin_body = $tr_t->text('MAIN');
$areas_val[] = ''; $areas_title[] = ''; foreach ($pt_cfg as $area => $opt) { $areas_val[] = $area; $areas_title[] = $opt['name']; } switch ($pt_cfg[$area]['period']) { case 2592000: $period = range(1, 12); $period_name = $L['paytop_month']; break; case 604800: $period = range(1, 48); $period_name = $L['paytop_week']; break; case 86400: $period = range(1, 100); $period_name = $L['paytop_day']; break; case 3600: $period = range(1, 100); $period_name = $L['paytop_hour']; break; default: $period = range(1, 12); $period_name = $L['paytop_month']; break; } $t->assign(array('TOP_FORM_ACTION_URL' => cot_url('admin', 'm=other&p=paytop&a=add'), 'TOP_FORM_PERIOD' => cot_selectbox($months, 'times', $period, $period, false), 'TOP_FORM_PERIOD_NAME' => $period_name, 'TOP_FORM_AREA' => cot_selectbox('', 'area', $areas_val, $areas_title, false))); $t->parse('MAIN'); $adminmain = $t->text('MAIN');
<?php /* ==================== [BEGIN_COT_EXT] Hooks=tags.search.pages.loop [END_COT_EXT] ==================== */ /** * Tag search for i18n pages * * @package I18n * @copyright (c) Cotonti Team * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt */ defined('COT_CODE') or die('Wrong URL'); if (!empty($row['ipage_title'])) { $tags = cot_tag_list($row['page_id'], 'pages', array('tag_locale' => $row['ipage_locale'])); $tag_list = ''; $tag_i = 0; foreach ($tags as $tag) { $tag_t = $cfg['plugin']['tags']['title'] ? cot_tag_title($tag) : $tag; $tag_u = $cfg['plugin']['tags']['translit'] ? cot_translit_encode($tag) : $tag; $tl = $lang != 'en' && $tag_u != $tag ? 1 : null; if ($tag_i > 0) { $tag_list .= ', '; } $tag_list .= cot_rc_link(cot_url('plug', array('e' => 'tags', 'a' => 'pages', 't' => str_replace(' ', '-', $tag_u), 'tl' => $tl)), htmlspecialchars($tag_t), 'rel="nofollow"'); $tag_i++; } $t->assign(array('TAGS_RESULT_ROW_URL' => empty($row['page_alias']) ? cot_url('page', 'c=' . $row['page_cat'] . '&id=' . $row['page_id'] . '&l=' . $row['ipage_locale']) : cot_url('page', 'c=' . $row['page_cat'] . '&al=' . $row['page_alias'] . '&l=' . $row['ipage_locale']), 'TAGS_RESULT_ROW_TITLE' => htmlspecialchars($row['ipage_title']), 'TAGS_RESULT_ROW_PATH' => cot_breadcrumbs(cot_i18n_build_catpath('page', $row['page_cat'], $row['ipage_locale']), false), 'TAGS_RESULT_ROW_TAGS' => $tag_list)); }
// Extrafields if (!empty(cot::$extrafields[cot::$db->contact])) { foreach (cot::$extrafields[cot::$db->contact] as $exfld) { $tag = mb_strtoupper($exfld['field_name']); $exfld_val = cot_build_extrafields_data('contact', $exfld, $row['contact_' . $exfld['field_name']]); $exfld_title = cot_extrafield_title($exfld, 'contact_'); $tuman->assign(array('CONTACT_' . $tag . '_TITLE' => $exfld_title, 'CONTACT_' . $tag => $exfld_val, 'CONTACT_' . $tag . '_VALUE' => $row['contact_' . $exfld['field_name']], 'CONTACT_EXTRAFLD_TITLE' => $exfld_title, 'CONTACT_EXTRAFLD' => $exfld['field_type'] == 'file' ? cot_rc_link($cfg['extrafield_files_dir'] . '/' . $exfld_val, $exfld_val) : $exfld_val, 'CONTACT_EXTRAFLD_VALUE' => $row['contact_' . $exfld['field_name']])); $tuman->parse('MAIN.DATA.EXTRAFLD'); } } $tuman->parse('MAIN.DATA'); } $sql->closeCursor(); if ($a == '' && !empty($id)) { $row = $db->query("SELECT * FROM " . cot::$db->contact . " WHERE contact_id = {$id}")->fetch(); $tuman->assign(array('CONTACT_DATE' => cot_date('date_full', $row['contact_date']), 'CONTACT_DATE_STAMP' => $row['contact_date'], 'CONTACT_USER' => $row['contact_authorid'] > 0 ? cot_build_user($row['contact_authorid'], $row['contact_author']) : $row['contact_author'], 'CONTACT_EMAIL' => $row['contact_email'], 'CONTACT_ID' => $row['contact_id'], 'CONTACT_DELLINK' => cot_url('admin', 'm=other&p=contact&a=del&id=' . $row['contact_id']), 'CONTACT_VAL' => $row['contact_val'] == 1 ? 'unval' : 'val', 'CONTACT_VALLINK' => cot_url('admin', 'm=other&p=contact&a=' . $val . '&id=' . $row['contact_id']), 'CONTACT_READLINK' => cot_url('admin', 'm=other&p=contact&a=val&id=' . $row['contact_id']), 'CONTACT_UNREADLINK' => cot_url('admin', 'm=other&p=contact&a=unval&id=' . $row['contact_id']), 'CONTACT_SUBJECT' => $row['contact_subject'], 'CONTACT_TEXT' => $row['contact_text'], 'CONTACT_REPLY' => $row['contact_reply'], 'CONTACT_FORM_SEND' => cot_url("admin", 'm=other&p=contact&a=send&id=' . $row['contact_id']), 'CONTACT_FORM_TEXT' => cot_textarea('rtext', $rtext, 8, 64))); // Extrafields if (!empty(cot::$extrafields[cot::$db->contact])) { foreach (cot::$extrafields[cot::$db->contact] as $exfld) { $tag = mb_strtoupper($exfld['field_name']); $exfld_val = cot_build_extrafields_data('contact', $exfld, $row['contact_' . $exfld['field_name']]); $exfld_title = cot_extrafield_title($exfld, 'contact_'); $tuman->assign(array('CONTACT_' . $tag . '_TITLE' => $exfld_title, 'CONTACT_' . $tag => $exfld_val, 'CONTACT_' . $tag . '_VALUE' => $row['contact_' . $exfld['field_name']], 'CONTACT_EXTRAFLD_TITLE' => $exfld_title, 'CONTACT_EXTRAFLD' => $exfld['field_type'] == 'file' ? cot_rc_link($cfg['extrafield_files_dir'] . '/' . $exfld_val, $exfld_val) : $exfld_val, 'CONTACT_EXTRAFLD_VALUE' => $row['contact_' . $exfld['field_name']])); $tuman->parse('MAIN.VIEW.EXTRAFLD'); } } $tuman->parse('MAIN.VIEW'); } cot_display_messages($tuman); $tuman->assign(array('CONTACT_PAGINATION' => $pagnav['main'], 'CONTACT_PREV' => $pagenav['prev'], 'CONTACT_NEXT' => $pagenav['next'])); $tuman->parse('MAIN');
cot_redirect(cot_url('page', $page_urlp, '', true, false, true)); } $out['subtitle'] = $L['i18n_editing']; $t = new XTemplate(cot_tplfile('i18n.page', 'plug')); $t->assign(array('I18N_ACTION' => cot_url('plug', "e=i18n&m=page&a=edit&id={$id}&l={$i18n_locale}"), 'I18N_TITLE' => $L['i18n_editing'], 'I18N_ORIGINAL_LANG' => $i18n_locales[$cfg['defaultlang']], 'I18N_LOCALIZED_LANG' => $i18n_locales[$i18n_locale], 'I18N_PAGE_TITLE' => htmlspecialchars($pag['page_title']), 'I18N_PAGE_DESC' => htmlspecialchars($pag['page_desc']), 'I18N_PAGE_TEXT' => cot_parse($pag['page_text'], $cfg['page']['markup']), 'I18N_IPAGE_TITLE' => htmlspecialchars($pag_i18n['ipage_title']), 'I18N_IPAGE_DESC' => htmlspecialchars($pag_i18n['ipage_desc']), 'I18N_IPAGE_TEXT' => cot_textarea('translate_text', $pag_i18n['ipage_text'], 32, 80, '', 'input_textarea_editor'))); cot_display_messages($t); /* === Hook === */ foreach (cot_getextplugins('i18n.page.edit.tags') as $pl) { include $pl; } /* =============*/ } elseif ($a == 'delete' && ($i18n_admin || $usr['id'] == $pag['ipage_translatorid'])) { // Send to trashcan if available if ($cfg['plugin']['trashcan']['trash_page']) { require_once cot_incfile('trashcan', 'plug'); $row = $db->query("SELECT * FROM {$db_i18n_pages}\n\t\t\t\tWHERE ipage_id = {$id} AND ipage_locale = '{$i18n_locale}'")->fetch(); cot_trash_put('i18n_page', $L['i18n_translation'] . " #{$id} ({$i18n_locale}) " . $row['ipage_title'], $id, $row); } $db->delete($db_i18n_pages, "ipage_id = {$id} AND ipage_locale = '{$i18n_locale}'"); /* === Hook === */ foreach (cot_getextplugins('i18n.page.delete.done') as $pl) { include $pl; } /* =============*/ cot_message('Deleted'); $page_urlp = empty($pag['page_alias']) ? 'c=' . $pag['page_cat'] . "id={$id}" : 'c=' . $pag['page_cat'] . 'al=' . $pag['page_alias']; cot_redirect(cot_url('page', $page_urlp, '', true)); } } else { cot_die(true, true); }
cot_log("Wrong validation URL", 'sec'); cot_redirect(cot_url('message', 'msg=157', '', true)); } } $mskin = cot_tplfile('users.register', 'module'); /* === Hook === */ foreach (cot_getextplugins('users.register.main') as $pl) { include $pl; } /* ===== */ $out['subtitle'] = $L['aut_registertitle']; $out['head'] .= $R['code_noindex']; require_once $cfg['system_dir'] . '/header.php'; $t = new XTemplate($mskin); require_once cot_incfile('forms'); $t->assign(array('USERS_REGISTER_TITLE' => $L['aut_registertitle'], 'USERS_REGISTER_SUBTITLE' => $L['aut_registersubtitle'], 'USERS_REGISTER_ADMINEMAIL' => $cot_adminemail, 'USERS_REGISTER_SEND' => cot_url('users', 'm=register&a=add'), 'USERS_REGISTER_USER' => cot_inputbox('text', 'rusername', $ruser['user_name'], array('size' => 24, 'maxlength' => 100)), 'USERS_REGISTER_EMAIL' => cot_inputbox('text', 'ruseremail', $ruser['user_email'], array('size' => 24, 'maxlength' => 64)), 'USERS_REGISTER_PASSWORD' => cot_inputbox('password', 'rpassword1', '', array('size' => 12, 'maxlength' => 32)), 'USERS_REGISTER_PASSWORDREPEAT' => cot_inputbox('password', 'rpassword2', '', array('size' => 12, 'maxlength' => 32)), 'USERS_REGISTER_COUNTRY' => cot_selectbox_countries($ruser['user_country'], 'rcountry'), 'USERS_REGISTER_TIMEZONE' => cot_selectbox_timezone($ruser['user_timezone'], 'rusertimezone'), 'USERS_REGISTER_GENDER' => cot_selectbox_gender($ruser['user_gender'], 'rusergender'), 'USERS_REGISTER_BIRTHDATE' => cot_selectbox_date(0, 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false))); // Extra fields if (!empty(cot::$extrafields[cot::$db->users])) { foreach (cot::$extrafields[cot::$db->users] as $exfld) { $uname = strtoupper($exfld['field_name']); $exfld_val = cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $ruser['user_' . $exfld['field_name']]); $exfld_title = cot_extrafield_title($exfld, 'user_'); $t->assign(array('USERS_REGISTER_' . $uname => $exfld_val, 'USERS_REGISTER_' . $uname . '_TITLE' => $exfld_title, 'USERS_REGISTER_EXTRAFLD' => $exfld_val, 'USERS_REGISTER_EXTRAFLD_TITLE' => $exfld_title)); $t->parse('MAIN.EXTRAFLD'); } } /* === Hook === */ foreach (cot_getextplugins('users.register.tags') as $pl) { include $pl; } /* ===== */
break; case 'page': require_once cot_incfile('page', 'module'); $pag = $db->query("SELECT * FROM {$db_pages} WHERE page_id=" . $score['ukarma_code'])->fetch(); $page_url = cot_url('page', 'c=' . $pag['page_cat'] . '&id=' . $score['ukarma_code']); $page_title = $pag['page_title']; break; case 'com': require_once cot_incfile('comments', 'plug'); require_once cot_incfile('page', 'module'); $pag = $db->query("SELECT c.*, p.* FROM {$db_com} AS c LEFT JOIN {$db_pages} AS p ON c.com_code = p.page_id WHERE c.com_id=" . $score['ukarma_code'] . " AND c.com_area='page'")->fetch(); $page_url = !empty($pag['page_alias']) ? cot_url('page', 'c=' . $pag['page_cat'] . '&al=' . $pag['page_alias']) . "#c" . $score['ukarma_code'] : cot_url('page', 'c=' . $pag['page_cat'] . '&id=' . $pag['page_id']) . "#c" . $score['ukarma_code']; $page_title = $pag['page_title']; break; default: $page_url = cot_url('users', 'm=details&id=' . $score['user_id'] . '&u=' . $score['user_name']); $page_title = $score['user_name']; break; } $t->assign(array('UKARMA_ROW_URL' => $page_url, 'UKARMA_ROW_TITLE' => $page_title)); /* === Hook - Part2 : Include === */ foreach ($extp as $pl) { include $pl; } /* ===== */ $t->parse("MAIN.UKARMA_ROW"); } /* === Hook === */ foreach (cot_getextplugins('ukarma.statistics.tags') as $pl) { include $pl; }
<?php /** * [BEGIN_COT_EXT] * Hooks=usertags.main * [END_COT_EXT] */ /** * plugin User Group Selector for Cotonti Siena * * @package usergroupselector * @version 1.0.0 * @author CMSWorks Team * @copyright Copyright (c) CMSWorks.ru, littledev.ru * @license BSD * */ defined('COT_CODE') or die('Wrong URL.'); if (is_array($user_data)) { if (empty($user_data['user_usergroup'])) { $user_data['user_usergroup'] = $user_data['user_maingrp']; } $temp_array['USERSELECTED_GROUP'] = $user_data['user_usergroup']; $temp_array['USERSELECTED_GROUP_ALIAS'] = $cot_groups[$user_data['user_usergroup']]['alias']; $temp_array['USERSELECTED_GROUP_NAME'] = $cot_groups[$user_data['user_usergroup']]['name']; $temp_array['USERSELECTED_GROUP_TITLE'] = $cot_groups[$user_data['user_usergroup']]['title']; $temp_array['USERSELECTED_GROUP_URL'] = cot_url('users', 'group=' . $cot_groups[$user_data['user_usergroup']]['alias']); }