Ejemplo n.º 1
0
function get_rss()
{
    global $aa;
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    $rss = array();
    $array = $aa->getCategoryTree('', '', FALSE);
    foreach ($array as $k => $v) {
        $name = '';
        for ($i = 0; $i < count($array[$k]); $i++) {
            $name .= $array[$k][$i + 1] . " > ";
            $i++;
        }
        $name = substr($name, 0, -3);
        $feed['name'] = $name;
        $feed['url'] = 'content';
        //the identifier for the rss feed url
        $feed['topic_id'] = $k;
        //the topic_id, empty on default (to select a certain category)
        $feed['path'] = 'content';
        //this is the plugin path location
        $feed['text'] = 'this is the rss feed for content category : ' . $name;
        $feed['class'] = '0';
        $feed['limit'] = '9';
        $rss[] = $feed;
    }
    return $rss;
}
Ejemplo n.º 2
0
 function status()
 {
     $sql = e107::getDb();
     $aa = new content();
     if ($maincat = $sql->retrieve("pcontent", "content_id, content_heading", " WHERE  content_parent  = '0' ORDER BY content_heading", true)) {
         $i = 0;
         foreach ($maincat as $row) {
             $count = 0;
             $array = $aa->getCategoryTree("", $row['content_id'], TRUE);
             $validparent = implode(",", array_keys($array));
             $qrycat = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
             $count = $sql->count("pcontent", "(*)", "WHERE " . $qrycat . "  AND content_refer != 'sa' ");
             $var[$i]['icon'] = "<img src='" . e_PLUGIN_ABS . "content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ";
             $var[$i]['title'] = $row['content_heading'];
             $var[$i]['url'] = e_PLUGIN . "content/admin_content_config.php?content." . $row['content_id'];
             $var[$i]['total'] = $count;
             $i = $i + 1;
         }
     }
     return $var;
 }
Ejemplo n.º 3
0
while ($rowm = $sqlm->db_Fetch()) {
    $ICON = "";
    $HEADING = "";
    $AUTHOR = "";
    $CATEGORY = "";
    $DATE = "";
    $INFO = "";
    $LIST_CAPTION = $rowm['content_heading'];
    //global var for this main parent
    $mainparent = $rowm['content_id'];
    //get path variables
    $content_recent_pref = $aa->getContentPref($mainparent);
    $content_recent_pref["content_icon_path"] = $content_recent_pref["content_icon_path"] ? $content_recent_pref["content_icon_path"] : "{e_PLUGIN_ABS}content/images/icon/";
    $content_icon_path = $tp->replaceConstants($content_recent_pref["content_icon_path"]);
    //prepare query string
    $array = $aa->getCategoryTree("", $mainparent, TRUE);
    $validparent = implode(",", array_keys($array));
    $qry = " content_refer !='sa' AND content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' AND content_class REGEXP '" . e_CLASS_REGEXP . "' ";
    //check so only the preferences from the correct content_type (article, content, review etc) are used and rendered
    if (substr($contentmode, 8) == $rowm['content_id']) {
        if ($mode == "new_page" || $mode == "new_menu") {
            $lvisit = $this->getlvisit();
            $qry = $qry . " AND content_datestamp>" . $lvisit;
        } else {
            $qry = $qry . " " . $datequery;
        }
        $qry .= " ORDER BY content_datestamp DESC LIMIT 0," . intval($arr[7]);
        //get recent content for each main parent
        $sqli = new db();
        if (!($resultitem = $sqli->db_Select("pcontent", "*", $qry))) {
            $LIST_DATA = CONTENT_MENU_LAN_5 . " " . $rowm['content_heading'];
Ejemplo n.º 4
0
            $content_pref = e107::unserialize($row['content_pref']);
            //$content_pref					= $eArrayStorage->ReadxxxArray($row['content_pref']);
            $content_pref["content_cat_icon_path_large"] = $content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/";
            $content_pref["content_cat_icon_path_small"] = $content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/";
            $content_cat_icon_path_large = $tp->replaceConstants($content_pref["content_cat_icon_path_large"]);
            $content_cat_icon_path_small = $tp->replaceConstants($content_pref["content_cat_icon_path_small"]);
            $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
            if ($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])) {
                $content_submit_type_table_string .= $tp->parseTemplate($CONTENT_SUBMIT_TYPE_TABLE, FALSE, $newcontent_shortcodes);
                $count = $count + 1;
            }
        }
        if ($count == "0") {
            $text .= "<div style='text-align:center;'>" . CONTENT_ADMIN_SUBMIT_LAN_0 . "</div>";
        } else {
            $text = $CONTENT_SUBMIT_TYPE_TABLE_START . $content_submit_type_table_string . $CONTENT_SUBMIT_TYPE_TABLE_END;
        }
    }
    $caption = CONTENT_ADMIN_SUBMIT_LAN_1;
    $ns->tablerender($caption, $text);
}
if (isset($qs[0]) && $qs[0] == "content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])) {
    //check if valid categories exist for this main parent
    $array = $aa->getCategoryTree("", intval($qs[2]), TRUE);
    $validparent = implode(",", array_keys($array));
    $qry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
    $sql2 = new db();
    //$contenttotal	= $sql2 -> db_Count($plugintable, "(*)", "WHERE ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " );
    $aform->show_create_content("submit");
}
require_once FOOTERF;
Ejemplo n.º 5
0
$fl = new e_file();
global $tp;
$deltest = array_flip($_POST);
// check query
if (isset($_POST['delete'])) {
    $tmp = array_pop(array_flip($_POST['delete']));
    list($delete, $del_id) = explode("_", $tmp);
}
$sql = e107::getDb();
// ##### DB ---------------------------------------------------------------------------------------
if (isset($delete) && $delete == 'cat') {
    $record = $sql->retrieve($plugintable, 'content_id,content_heading,content_parent', "content_id = '{$del_id}' ");
    $content_id = $record['content_id'];
    $content_heading = $record['content_heading'];
    $content_parent = $record['content_parent'];
    $checkarray = $aa->getCategoryTree("", $content_id, TRUE);
    unset($agc);
    //unset the globalised getCategoryTree array
    $checkvalidparent = implode(",", array_keys($checkarray));
    $checkqry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($checkvalidparent) . "' ";
    //check if subcats present
    if (count($array) > 1) {
        //subcategories found don't delete
        $checkermsg .= CONTENT_ADMIN_CAT_LAN_36 . "<br />";
        $checksubcat = TRUE;
    } else {
        $checkermsg .= CONTENT_ADMIN_CAT_LAN_39 . "<br />";
        $checksubcat = FALSE;
    }
    //check if items present
    if ($sql->count($plugintable, "(*)", "WHERE " . $checkqry . " ")) {