* [END_COT_EXT]
 */
/**
 * plugin tagslance for Cotonti Siena
 * 
 * @package tagslance
 * @version 1.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
if ($cfg['plugin']['tagslance']['projects'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    // I18n
    if (cot_get_caller() == 'i18n.projects') {
        global $i18n_locale;
        $tags_extra = array('tag_locale' => $i18n_locale);
    } else {
        $tags_extra = null;
    }
    $rtags = cot_import('rtags', 'P', 'TXT');
    $tags = cot_tag_parse($rtags);
    $old_tags = cot_tag_list($id, 'projects', $tags_extra);
    $kept_tags = array();
    $new_tags = array();
    // Find new tags, count old tags that have been left
    $cnt = 0;
    foreach ($tags as $tag) {
        $p = array_search($tag, $old_tags);
        if ($p !== false) {
<?php

/** 
 * [BEGIN_COT_EXT]
 * Hooks=market.add.tags
 * [END_COT_EXT]
 */
/**
 * plugin tagslance for Cotonti Siena
 * 
 * @package tagslance
 * @version 1.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
if ($cfg['plugin']['tagslance']['market'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    $t->assign(array('PRDADD_TOP_TAGS' => $L['Tags'], 'PRDADD_TOP_TAGS_HINT' => $L['tags_comma_separated'], 'PRDADD_FORM_TAGS' => cot_rc('tags_input_editpage', array('tags' => ''))));
    if (cot_get_caller() == 'i18n.market') {
        $t->assign(array('I18N_PRD_TAGS' => implode(', ', cot_tag_list($id)), 'I18N_IPRD_TAGS' => cot_rc('tags_input_editpage', array('tags' => ''))));
    }
    $t->parse('MAIN.TAGS');
}
/** 
 * [BEGIN_COT_EXT]
 * Hooks=market.edit.tags
 * [END_COT_EXT]
 */
/**
 * plugin tagslance for Cotonti Siena
 * 
 * @package tagslance
 * @version 1.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
if ($cfg['plugin']['tagslance']['market'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    $tags_caller = cot_get_caller();
    if ($tags_caller == 'i18n.market') {
        $tags_extra = array('tag_locale' => $i18n_locale);
    } else {
        $tags_extra = null;
    }
    $tags = cot_tag_list($id, 'market', $tags_extra);
    $tags = implode(', ', $tags);
    $t->assign(array('PRDEDIT_TOP_TAGS' => $L['Tags'], 'PRDEDIT_TOP_TAGS_HINT' => $L['tags_comma_separated'], 'PRDEDIT_FORM_TAGS' => cot_rc('tags_input_editpage')));
    if ($tags_caller == 'i18n.market') {
        $t->assign(array('I18N_PRD_TAGS' => implode(', ', cot_tag_list($id)), 'I18N_IPRD_TAGS' => cot_rc('tags_input_editpage')));
    }
    $t->parse('MAIN.TAGS');
}
Ejemplo n.º 4
0
[BEGIN_COT_EXT]
Hooks=page.edit.update.done,i18n.page.edit.update
[END_COT_EXT]
==================== */
/**
 * Updates page tags
 *
 * @package Tags
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL');
if ($cfg['plugin']['tags']['pages'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    // I18n
    if (cot_get_caller() == 'i18n.page') {
        global $i18n_locale;
        $tags_extra = array('tag_locale' => $i18n_locale);
    } else {
        $tags_extra = null;
    }
    $rtags = cot_import('rtags', 'P', 'TXT');
    $tags = cot_tag_parse($rtags);
    $old_tags = cot_tag_list($id, 'pages', $tags_extra);
    $kept_tags = array();
    $new_tags = array();
    // Find new tags, count old tags that have been left
    $cnt = 0;
    foreach ($tags as $tag) {
        $p = array_search($tag, $old_tags);
        if ($p !== false) {
Ejemplo n.º 5
0
<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=page.add.tags,page.edit.tags
Tags=page.add.tpl:{PAGEADD_FORM_PFS},{PAGEADD_FORM_SFS},{PAGEADD_FORM_URL_PFS},{PAGEADD_FORM_URL_SFS};page.edit.tpl:{PAGEEDIT_FORM_PFS},{PAGEEDIT_FORM_SFS},{PAGEEDIT_FORM_URL_PFS},{PAGEEDIT_FORM_URL_SFS}
[END_COT_EXT]
==================== */
/**
 * PFS link on page.add
 *
 * @package PFS
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_incfile('pfs', 'module');
if (cot_get_caller() == 'page.add') {
    $pfs_tag = 'PAGEADD';
} else {
    $pfs_tag = 'PAGEEDIT';
}
$t->assign(array($pfs_tag . '_FORM_PFS' => cot_build_pfs($usr['id'], 'pageform', 'rpagetext', $L['Mypfs'], $sys['parser']), $pfs_tag . '_FORM_SFS' => cot_auth('pfs', 'a', 'A') ? ' &nbsp; ' . cot_build_pfs(0, 'pageform', 'rpagetext', $L['SFS'], $sys['parser']) : '', $pfs_tag . '_FORM_URL_PFS' => cot_build_pfs($usr['id'], 'pageform', 'rpageurl', $L['Mypfs']), $pfs_tag . '_FORM_URL_SFS' => cot_auth('pfs', 'a', 'A') ? ' ' . cot_build_pfs(0, 'pageform', 'rpageurl', $L['SFS']) : ''));
Ejemplo n.º 6
0
/* ====================
[BEGIN_COT_EXT]
Hooks=forums.editpost.tags, forums.posts.newpost.tags, forums.newtopic.tags
Tags=forums.editpost.tpl:{FORUMS_EDITPOST_MYPFS};forums.editpost.tpl:{FORUMS_POSTS_NEWPOST_MYPFS};forums.newtopic.tpl:{FORUMS_NEWTOPIC_MYPFS}
[END_COT_EXT]
==================== */
/**
 * PFS links for forums
 *
 * @package PFS
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_incfile('pfs', 'module');
$pfs_caller = cot_get_caller();
if ($pfs_caller == 'forums.posts') {
    $pfs_src = 'newpost';
    $pfs_name = 'rmsgtext';
    $pfs_tag = 'POSTS_NEWPOST';
} elseif ($pfs_caller == 'forums.newtopic') {
    $pfs_src = 'newtopic';
    $pfs_name = 'rmsgtext';
    $pfs_tag = 'NEWTOPIC';
} else {
    $pfs_src = 'editpost';
    $pfs_name = 'rmsgtext';
    $pfs_tag = 'EDITPOST';
}
$pfs = cot_build_pfs($usr['id'], $pfs_src, $pfs_name, $L['Mypfs']);
$pfs .= cot_auth('pfs', 'a', 'A') ? ' &nbsp; ' . cot_build_pfs(0, $pfs_src, $pfs_name, $L['SFS']) : '';
/** 
 * [BEGIN_COT_EXT]
 * Hooks=market.add.add.done
 * [END_COT_EXT]
 */
/**
 * plugin tagslance for Cotonti Siena
 * 
 * @package tagslance
 * @version 1.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
if ($cfg['plugin']['tagslance']['market'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    // I18n
    $tags_extra = cot_get_caller() == 'i18n.market' ? array('tag_locale' => $i18n_locale) : null;
    $rtags = cot_import('rtags', 'P', 'TXT');
    $tags = cot_tag_parse($rtags);
    $cnt = 0;
    foreach ($tags as $tag) {
        cot_tag($tag, $id, 'market', $tags_extra);
        $cnt++;
        if ($cfg['plugin']['tags']['limit'] > 0 && $cnt == $cfg['plugin']['tags']['limit']) {
            break;
        }
    }
}
<?php

/** 
 * [BEGIN_COT_EXT]
 * Hooks=folio.edit.delete.done
 * [END_COT_EXT]
 */
/**
 * plugin tagslance for Cotonti Siena
 * 
 * @package tagslance
 * @version 1.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
if ($cfg['plugin']['tagslance']['folio'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    if (cot_get_caller() == 'i18n.folio') {
        $tags_extra = array('tag_locale' => $i18n_locale);
    } else {
        $tags_extra = null;
    }
    cot_tag_remove_all($id, 'folio', $tags_extra);
}
Ejemplo n.º 9
0
<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=pm.reply.tags,pm.send.tags
Tags=pm.message.tpl:{PM_FORM_PFS};pm.send.tpl:{PMSEND_FORM_PFS}
[END_COT_EXT]
==================== */
/**
 * PFS link for forums.editpost
 *
 * @package PFS
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_incfile('pfs', 'module');
$pfs = cot_build_pfs($usr['id'], 'newlink', 'newpmtext', $L['Mypfs']);
$pfs .= cot_auth('pfs', 'a', 'A') ? ' &nbsp; ' . cot_build_pfs(0, 'newlink', 'newpmtext', $L['SFS']) : '';
$pfs_tag = cot_get_caller() == 'pm.send' ? 'PMSEND_FORM_PFS' : 'PM_FORM_PFS';
$t->assign($pfs_tag, $pfs);
Ejemplo n.º 10
0
<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=comments.newcomment.tags,comments.edit.tags
Tags=comments.tpl:{COMMENTS_FORM_PFS},{COMMENTS_FORM_SFS}
[END_COT_EXT]
==================== */
/**
 * PFS link on page.add
 *
 * @package PFS
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_incfile('pfs', 'module');
global $usr, $L, $sys;
if (cot_get_caller() == 'comments.functions') {
    $form_name = 'newcomment';
    $input_name = 'rtext';
} else {
    $form_name = 'comments';
    $input_name = 'comtext';
}
$t->assign(array('COMMENTS_FORM_PFS' => cot_build_pfs($usr['id'], $form_name, $input_name, $L['Mypfs'], $sys['parser']), 'COMMENTS_FORM_SFS' => cot_auth('pfs', 'a', 'A') ? ' &nbsp; ' . cot_build_pfs(0, $form_name, $input_name, $L['SFS'], $sys['parser']) : ''));
/** 
 * [BEGIN_COT_EXT]
 * Hooks=projects.add.add.done
 * [END_COT_EXT]
 */
/**
 * plugin tagslance for Cotonti Siena
 * 
 * @package tagslance
 * @version 1.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
if ($cfg['plugin']['tagslance']['projects'] && cot_auth('plug', 'tags', 'W')) {
    require_once cot_incfile('tags', 'plug');
    // I18n
    $tags_extra = cot_get_caller() == 'i18n.projects' ? array('tag_locale' => $i18n_locale) : null;
    $rtags = cot_import('rtags', 'P', 'TXT');
    $tags = cot_tag_parse($rtags);
    $cnt = 0;
    foreach ($tags as $tag) {
        cot_tag($tag, $id, 'projects', $tags_extra);
        $cnt++;
        if ($cfg['plugin']['tags']['limit'] > 0 && $cnt == $cfg['plugin']['tags']['limit']) {
            break;
        }
    }
}