131
playsome
xcgal 2.02 lightbox
  • 2010/7/17 13:57

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello,

I download xcgal 2.02 lightbox fromhttp://xoopsfire.com/modules/wfdownloads/ however I cant seem to get the lightbox to work after checking 'yes' in use the lightbox feature in preferences.

There is some text in spanish(i think) that may shed some light on how to use it, google translate makes no sense can anyone who speaks spanish translate this:

Se marcado como sim o xcgal mudar� o link das miniaturas e n�o mostrar� as imagens na tela padr�o, mas sim criar� uma bela tela de exibi��o animada na pr�pria p�gina das miniaturas. Aten��o: Caso o light box estiver ativo voc� perder� a fun��o de comentar as fotos, enviar cart�es e avaliar as fotos.*

Has anyone gotten xcgal lightbox working with 2.4.5 or 2.4.4?

Is there another gallery module that has lightbox functionality?

Thanks



132
playsome
Re: RMCommon Utilities 2 and MyWords 2 (Alpha)
  • 2010/7/15 13:38

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi, just a quick question about quickpages, ive installed it its looking great however I cant seem to get the caegories to display in order by ID on the index page, im using it for a whats on guide so I need the categories to display in day order, I tried editing some code in home.php changing sort by ASC to DESC but I think that changes the pages order and not the caegories and there is no function in the module (what i can see) to weight categories or sort them by ID, I have created them in day order so Mon is ID=1 and Fri is ID=5, anyone got any ideas?

Thanks



133
playsome
Re: How do we implement the Google feedburner for our RSS feeds
  • 2009/9/24 12:36

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello, when setting up your feedburner feed you need to provide the full link to the feed. For news module it will behttp://www.yourxoopssite.com/backend.php not sure about the newbb module though, although i do think it has it's own rss feed.



134
playsome
Re: How to remove /module/ from URL & change the module name in URL
  • 2009/9/17 16:49

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15





135
playsome
Re: Article module - begging for help
  • 2009/9/12 13:49

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi Ghia, thanks for your help, to be honest I did not understand what you said, I'm afraid my knowledge of PHP is limited and that stuff is just way over my head.

However I have made a couple of hacks to xml.php code if anyone is interested in using it.

1. Before when viewing RSS for a category the page title showed as SiteName::Category, it did not show the actual category name it just showed the word 'category', I have modified it so the pagetitle shows the actual category name example here

2. Hardcoded in links to shortened URLs created by the XoWreriteModules hack by Dugris before the links showed the old "/modules/" urls

3. Hardcoded in a diifferent image so it can show a custom image (image would display on feedburner pages) instead of the module logo.

Here is my revised code for xml.php:
<?php
/**
 * Article module for XOOPS
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code 
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <phppp@users.sourceforge.net>
 * @version         $Id: xml.php 2283 2008-10-12 03:36:13Z phppp $
 */
 
ob_start();
include 
"header.php";
error_reporting(0);
$xoopsLogger->activated false;

if (
art_parse_args($args_num$args$args_str)) {
    
$args["article"] = !empty($args["article"]) ? $args["article"] : @$args_num[0];
    
$args["type"] = @$args_str[0];
}

$article_id intval( empty($_GET["article"]) ? @$args["article"] : $_GET["article"] );
$category_id intval( empty($_GET["category"]) ? @$args["category"] : $_GET["category"] );
$page intval( empty($_GET["page"]) ? @$args["page"] : $_GET["page"] );
$uid intval( empty($_GET["uid"]) ? @$args["uid"] : $_GET["uid"] );
$type = empty($_GET["type"]) ? (empty($_GET["op"]) ? @$args["type"] : $_GET["op"]) : $_GET["type"];
$type strtoupper($type);

$category_handler =& xoops_getmodulehandler("category"$GLOBALS["artdirname"]);
$article_handler =& xoops_getmodulehandler("article"$GLOBALS["artdirname"]);
$article_obj =& $article_handler->get($article_id);
if (
$article_id 0) {
    
$criteria = new CriteriaCompo(new Criteria("ac.ac_publish"0">"));
    
$categories_obj =& $category_handler->getByArticle($article_id$criteria);
    if (
count($categories_obj) ==|| !in_array($category_idarray_keys($categories_obj))) $category_id=0;
    unset(
$categories_obj);
    
$category_id = empty($category_id)?$article_obj->getVar("cat_id"):$category_id;
}

$category_obj =& $category_handler->get($category_id);

$_uid = empty($xoopsUser) ? $xoopsUser->getVar("uid");
$isAuthor = ( $article_obj->isNew() || $_uid == $article_obj->getVar("uid") );
$isAdmin $category_handler->getPermission($category_obj"moderate");

if (
$isAuthor || ($isAdmin && $article_handler->getCategoryStatus($category_id$article_id) !== NULL)) {
} elseif (
    empty(
$category_id)
    || !
$category_handler->getPermission($category_obj"view")
    || !
$article_obj->getVar("art_time_publish")
    ){
    
art_trackback_response(1art_constant("MD_NOACCESS"));
}

if (
$type == "RDF"$type "RSS1.0";
if (
$type == "RSS"$type "RSS0.91";

$valid_format = array("RSS0.91""RSS1.0""RSS2.0""PIE0.1""MBOX""OPML""ATOM""ATOM0.3""HTML""JS");
if (empty(
$type) || !in_array($type$valid_format)) {
    
$type "RSS";
}

if (
$article_id 0) {
    
$myuid = empty($xoopsUser) ? $xoopsUser->getVar("uid");
    
$isAuthor = ($article_obj->isNew() || $myuid == $article_obj->getVar("uid"));
    
$isAdmin $category_handler->getPermission($category_obj"moderate");
    
    if (
$isAuthor || ($isAdmin && $article_handler->getCategoryStatus($category_id$article_id)!==NULL)){
    } elseif (
        empty(
$category_id)
        || !
$category_handler->getPermission($category_obj"view")
        || !
$article_obj->getVar("art_time_publish")
        ){
        
art_trackback_response(1art_constant("MD_NOACCESS"));
    }
}
$xml_charset = empty($xoopsModuleConfig["do_rssutf8"]) ? _CHARSET "UTF-8";

include_once 
XOOPS_ROOT_PATH '/class/template.php';

$tpl = new XoopsTpl();
$tpl->caching 2;
$tpl->cache_lifetime 3600;
load_functions("cache");
$xoopsCachedTemplateId md5mod_generateCacheId() . str_replaceXOOPS_URL''$_SERVER['REQUEST_URI'] ) );
if (!
$tpl->is_cached('db:system_dummy.html'$xoopsCachedTemplateId)) {
    if (!empty(
$article_id)) $source "article";
    elseif (!empty(
$category_id)) $source "category";
    elseif (!empty(
$uid)) $source "author";
    else 
$source "index";
    
    
$items = array();

    switch (
$source) {
        case 
"article":
            
$category_id = empty($category_id)?$article_obj->getVar("cat_id"):$category_id;
            
$category_obj =& $category_handler->get($category_id);
    
            if (empty(
$category_obj) || !$category_handler->getPermission($category_obj"view")) {
                
art_trackback_response(1art_constant("MD_NOACCESS"));
            }
    
            
$pagetitle art_constant("MD_ARTICLE");
            
$rssdesc art_constant("MD_XMLDESC_ARTICLE");
    
            
$author $article_obj->getAuthor(true);
            
$text $article_obj->getText($page);
    
            
$content art_constant("MD_CATEGORY") . ": " $category_obj->getVar("cat_title");
            if (
$text["title"]) {
                
$content .= "<br />" art_constant("MD_SUBTITLE") . ": " $text["title"];
            }
            
$source_author $author["author"];
            
$source_source $article_obj->getVar("art_source");
            if (!empty(
$source_author)||!empty($source_source)) {
                
$content .= "<br />" art_constant("MD_SOURCE") . ": " $source_author "(" $source_source ")";
            }
            if (
$article_obj->getVar("art_keywords")) {
                
$content .=    "<br />" art_constant("MD_KEYWORDS") . ": " $article_obj->getVar("art_keywords");
            }
            if (
$summary $article_obj->getSummary()) {
                
$content .=    "<br />" art_constant("MD_SUMMARY") . ": " $summary;
            }
            
$content .=    $text["body"] . "<br />";
            
$items[] = array(
                
"title"            => $article_obj->getVar("art_title"),
                
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article_obj->getVar("art_id") . "/c" $category_id,
                
"description"    => $content,
                
"descriptionHtmlSyndicated" => true,
                
"date"            => $article_obj->getTime("rss"),
                
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                
"author"        => $author["name"]
                );
            
$xml_link XOOPS_URL "/news/view.article.php" URL_DELIMITER $article_obj->getVar("art_id") . "/c" $category_id;
                
            break;
    
        case 
"category":
            
$category_obj =& $category_handler->get($category_id);
    
            if (empty(
$category_obj) || !$category_handler->getPermission($category_obj"access")) {
                
art_trackback_response(1art_constant("MD_NOACCESS"));
            }
            
$pagetitle art_constant("MD_CATEGORY");
            
$rssdesc sprintf(art_constant("MD_XMLDESC_CATEGORY"), $category_obj->getVar("cat_title"));
    
            
$criteria = new CriteriaCompo(new Criteria("ac.ac_publish"0">"));
            
$articles_obj =& $article_handler->getByCategory(
                
$category_id,
                
$xoopsModuleConfig["articles_perpage"],
                
0,
                
$criteria,
                array(
"a.art_title""a.art_time_publish""a.art_keywords""a.art_summary""a.uid""a.art_source")
            );
    
            foreach (
$articles_obj as $id => $article) {
                
$uids[$article->getVar("uid")] = 1;
            }
            
$users art_getUnameFromId(array_keys($uids));
    
            foreach (
$articles_obj as $id => $article) {
                
$content art_constant("MD_TITLE") . ": " $article->getVar("art_title"). "<br />";
                
$content .=    art_constant("MD_SUMMARY") . ": " $article->getSummary(true);
                
$items[] = array(
                    
"title"            => $article->getVar("art_title"),
                    
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article->getVar("art_id") . "/c" $category_id,
                    
"description"    => $content,
                    
"descriptionHtmlSyndicated" => true,
                    
"date"            => $article->getTime("rss"),
                    
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                    
"author"        => $users[$article->getVar("uid")]
                    );
            }
            
$xml_link XOOPS_URL "/news/view.category.php" URL_DELIMITER $category_id;
            break;
    
        case 
"author":
            
$author_name XoopsUser::getUnameFromId($uid);
            
$pagetitle art_constant("MD_AUTHOR");
            
$rssdesc sprintf(art_constant("MD_XMLDESC_AUTHOR"), $author_name);
    
            
$categories_obj $category_handler->getAllByPermission("access", array("cat_title""cat_moderator"));
            
$categories_id array_keys($categories_obj);
            if (
count($categories_id) == 0) {
                
$items = array();
                break;
            }
            
$criteria = new CriteriaCompo(new Criteria("a.uid"intval($uid)));
            
$criteria->add(new Criteria("ac.ac_publish"0">"));
            
$articles_obj =& $article_handler->getByCategory(
                
$categories_id,
                
$xoopsModuleConfig["articles_perpage"],
                
0,
                
$criteria,
                array(
"a.art_title""a.cat_id""a.art_time_publish""a.art_keywords""a.art_summary""a.art_source")
            );
            foreach (
$articles_obj as $id => $article) {
                
$content art_constant("MD_CATEGORY") . ": " $categories_obj[$article->getVar("cat_id")]->getVar("cat_title") . "<br />";
                
$content .= art_constant("MD_TITLE") . ": " $article->getVar("art_title") . "<br />";
                
$content .=    art_constant("MD_SUMMARY") . ": " $article->getSummary(true);
                
$items[] = array(
                    
"title"            => $article->getVar("art_title"),
                    
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article->getVar("art_id") . "/c" $article->getVar("cat_id"),
                    
"description"    => $content,
                    
"descriptionHtmlSyndicated" => true,
                    
"date"            => $article->getTime("rss"),
                    
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                    
"author"        => $author_name
                    
);
            }
            
$xml_link XOOPS_URL "/news/view.author.php" URL_DELIMITER $uid;
            break;
    
        case 
"index":
        default:
            
$pagetitle art_constant("MD_INDEX");
            
$rssdesc art_constant("MD_XMLDESC_INDEX");
    
            
$categories_obj $category_handler->getAllByPermission("access", array("cat_title""cat_moderator"));
            
$categories_id array_keys($categories_obj);
            if(
count($categories_id)==0){
                
$items=array();
                break;
            }
            
$criteria = new CriteriaCompo(new Criteria("cat_id""(".implode(",",$categories_id).")""IN"));
            
$criteria->add(new Criteria("art_time_publish"0">"));
            
$criteria->setLimit($xoopsModuleConfig["articles_perpage"]);
            
$articles_obj $article_handler->getAll($criteria
                array(
"art_title""uid""cat_id""art_time_publish""art_keywords""art_summary""art_source")
            );
            
/*
            $articles_obj =& $article_handler->getPublished(
                $xoopsModuleConfig["articles_perpage"],
                0,
                $criteria,
                array("art_title", "uid", "cat_id", "art_time_publish", "art_keywords", "art_summary", "art_author", "art_source")
            );
            */
            
foreach ($articles_obj as $id => $article) {
                
$uids[$article->getVar("uid")] = 1;
            }
            
$users art_getUnameFromId(array_keys($uids));
    
            foreach (
$articles_obj as $id => $article) {
                
$content art_constant("MD_CATEGORY") . ": " $categories_obj[$article->getVar("cat_id")]->getVar("cat_title") . "<br />";
                
$content .= art_constant("MD_TITLE") . ": " $article->getVar("art_title") . "<br />";
                
$content .=    art_constant("MD_SUMMARY") . ": " $article->getSummary(true);
                
$items[] = array(
                    
"title"            => $article->getVar("art_title"),
                    
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article->getVar("art_id") . "/c" $article->getVar("cat_id"),
                    
"description"    => $content,
                    
"descriptionHtmlSyndicated" => true,
                    
"date"            => $article->getTime("rss"),
                    
"source"        => XOOPS_URL "/news/",
                    
"author"        => $users[$article->getVar("uid")]
                    );
            }
            
$xml_link XOOPS_URL "/news/";
            break;
    }
    
    
$xml_charset = empty($xoopsModuleConfig["do_rssutf8"]) ? _CHARSET "UTF-8";
    
    
$xml_handler =& xoops_getmodulehandler("xml"$GLOBALS["artdirname"]);
    
$xml $xml_handler->create($type);
    
$xml->setVar("encoding"$xml_charset);
    
//edited line below to add cat_title 11sep09
    
$xml->setVar("title"$xoopsConfig["sitename"] . " : " $category_obj->getVar("cat_title"),"UTF-8"$xml_charsettrue);
    
$xml->setVar("description"$rssdesctrue);
    
$xml->setVar("descriptionHtmlSyndicated"true);
    
$xml->setVar("link"$xml_link);
    
$xml->setVar("syndicationURL"XOOPS_URL "/" xoops_getenv("PHP_SELF"));
    
$xml->setVar("webmaster"checkEmail($xoopsConfig["adminmail"], true));
    
$xml->setVar("editor"checkEmail($xoopsConfig["adminmail"], true));
    
$xml->setVar("category"$xoopsModule->getVar("name"), true);
    
$xml->setVar("generator"$xoopsModule->getInfo("version"));
    
$xml->setVar("language"_LANGCODE);
    
    
//$dimention = @getimagesize(XOOPS_ROOT_PATH . "/modules/" . $GLOBALS["artdirname"] . "/" . $xoopsModule->getInfo("image"));
    
$image = array(
        
"width"            => @$dimention[0],
        
"height"        => @$dimention[1],
        
"title"            => $xoopsConfig["sitename"],
        
"url"            => XOOPS_URL "/images/psnews_feed_img.gif",
        
"link"            => XOOPS_URL "/news/",
        
"description"    => $rssdesc
        
);
    
$xml->setImage($image);
    
    
/*
    $item = array(
        "title" => $datatitle,
        "link" => $dataurl,
        "description" => $datadesc,
        "descriptionHtmlSyndicated" => true,
        "date" => $datadate,
        "source" => $datasource,
        "author" => $dataauthor
        );
    */
    
$xml->addItems($items);
    
    
$dummy_content $xml_handler->display($xmlXOOPS_CACHE_PATH."/".$GLOBALS["artdirname"].".xml.tmp");
    
$dummy_content $xml_handler->display($xml);
    
    
$tpl->assign_by_ref('dummy_content'$dummy_content);
}
//$content = ob_get_contents();
ob_end_clean();

header('Content-Type:text/xml; charset=' $xml_charset);
$tpl->display('db:system_dummy.html'$xoopsCachedTemplateId);
?>


Something you may have to change to suit your own site.

Things still needing fixed or hacked:

1. Feeds for index page RSS need fixed to show 10 most recent articles instead of the 10 oldest.

2. Hack to show the uploaded article image in the feed would be good to.

playsome



136
playsome
Re: Trying to wrap my head around all this...
  • 2009/9/11 20:23

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hey caponey, I think i know what your trying to do, are you trying to get something like PSU.com or IGN where they could have an article about a game then in blocks or else where on the page they would have related content like reviews, game page, etc?

I am also making a gaming site (for PS3) using XOOPS and I had wanted to do this also, but I could not figure it out and it was probably way beyond what i can do with PHP.

The only way I can think of how they do it is using somesort of hook, like they would have there game database and an ID for each game, they could the create other content like news, reviews and use that same ID then on the main game page they could use that id/hook to call and generate other content related to that game.

Not too sure how you would do it in xoops, would need to make a custom module for games (game database) then use php code to call otehr content for that game using the tabs or links as you say, like this

Im interested to know if the devs can think of a way to do this with XOOPS its something i would like to implement on my site also.



137
playsome
Re: Article module - begging for help
  • 2009/9/10 19:33

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


I think its OK now, sorry, must have been a browser cache issue.

I have just one last problem, the xml for the index page here shows the first 10 articles i posted in reverse date format and it does not change as i post more articles, the rss per category shows the latest articles so that is fine, how can I fix the rss for the index page so the latest articles show and in the correct date order?

Thanks



138
playsome
Re: Article module - begging for help
  • 2009/9/10 19:12

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi Ghia,

thanks for your help this has worked, but I think ive missed something but I have looked and cant find what ive missed.

The extra / is now gone from the URL in links on the index rss here but it remains on the image link.

The extra / is still present on the URL links on the category RSS here and also on the image link.

Here is the code for xml.php:
<?php
/**
 * Article module for XOOPS
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code 
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <phppp@users.sourceforge.net>
 * @version         $Id: xml.php 2283 2008-10-12 03:36:13Z phppp $
 */
 
ob_start();
include 
"header.php";
error_reporting(0);
$xoopsLogger->activated false;

if (
art_parse_args($args_num$args$args_str)) {
    
$args["article"] = !empty($args["article"]) ? $args["article"] : @$args_num[0];
    
$args["type"] = @$args_str[0];
}

$article_id intval( empty($_GET["article"]) ? @$args["article"] : $_GET["article"] );
$category_id intval( empty($_GET["category"]) ? @$args["category"] : $_GET["category"] );
$page intval( empty($_GET["page"]) ? @$args["page"] : $_GET["page"] );
$uid intval( empty($_GET["uid"]) ? @$args["uid"] : $_GET["uid"] );
$type = empty($_GET["type"]) ? (empty($_GET["op"]) ? @$args["type"] : $_GET["op"]) : $_GET["type"];
$type strtoupper($type);

$category_handler =& xoops_getmodulehandler("category"$GLOBALS["artdirname"]);
$article_handler =& xoops_getmodulehandler("article"$GLOBALS["artdirname"]);
$article_obj =& $article_handler->get($article_id);
if (
$article_id 0) {
    
$criteria = new CriteriaCompo(new Criteria("ac.ac_publish"0">"));
    
$categories_obj =& $category_handler->getByArticle($article_id$criteria);
    if (
count($categories_obj) ==|| !in_array($category_idarray_keys($categories_obj))) $category_id=0;
    unset(
$categories_obj);
    
$category_id = empty($category_id)?$article_obj->getVar("cat_id"):$category_id;
}

$category_obj =& $category_handler->get($category_id);

$_uid = empty($xoopsUser) ? $xoopsUser->getVar("uid");
$isAuthor = ( $article_obj->isNew() || $_uid == $article_obj->getVar("uid") );
$isAdmin $category_handler->getPermission($category_obj"moderate");

if (
$isAuthor || ($isAdmin && $article_handler->getCategoryStatus($category_id$article_id) !== NULL)) {
} elseif (
    empty(
$category_id)
    || !
$category_handler->getPermission($category_obj"view")
    || !
$article_obj->getVar("art_time_publish")
    ){
    
art_trackback_response(1art_constant("MD_NOACCESS"));
}

if (
$type == "RDF"$type "RSS1.0";
if (
$type == "RSS"$type "RSS0.91";

$valid_format = array("RSS0.91""RSS1.0""RSS2.0""PIE0.1""MBOX""OPML""ATOM""ATOM0.3""HTML""JS");
if (empty(
$type) || !in_array($type$valid_format)) {
    
$type "RSS";
}

if (
$article_id 0) {
    
$myuid = empty($xoopsUser) ? $xoopsUser->getVar("uid");
    
$isAuthor = ($article_obj->isNew() || $myuid == $article_obj->getVar("uid"));
    
$isAdmin $category_handler->getPermission($category_obj"moderate");
    
    if (
$isAuthor || ($isAdmin && $article_handler->getCategoryStatus($category_id$article_id)!==NULL)){
    } elseif (
        empty(
$category_id)
        || !
$category_handler->getPermission($category_obj"view")
        || !
$article_obj->getVar("art_time_publish")
        ){
        
art_trackback_response(1art_constant("MD_NOACCESS"));
    }
}
$xml_charset = empty($xoopsModuleConfig["do_rssutf8"]) ? _CHARSET "UTF-8";

include_once 
XOOPS_ROOT_PATH '/class/template.php';

$tpl = new XoopsTpl();
$tpl->caching 2;
$tpl->cache_lifetime 3600;
load_functions("cache");
$xoopsCachedTemplateId md5mod_generateCacheId() . str_replaceXOOPS_URL''$_SERVER['REQUEST_URI'] ) );
if (!
$tpl->is_cached('db:system_dummy.html'$xoopsCachedTemplateId)) {
    if (!empty(
$article_id)) $source "article";
    elseif (!empty(
$category_id)) $source "category";
    elseif (!empty(
$uid)) $source "author";
    else 
$source "index";
    
    
$items = array();

    switch (
$source) {
        case 
"article":
            
$category_id = empty($category_id)?$article_obj->getVar("cat_id"):$category_id;
            
$category_obj =& $category_handler->get($category_id);
    
            if (empty(
$category_obj) || !$category_handler->getPermission($category_obj"view")) {
                
art_trackback_response(1art_constant("MD_NOACCESS"));
            }
    
            
$pagetitle art_constant("MD_ARTICLE");
            
$rssdesc art_constant("MD_XMLDESC_ARTICLE");
    
            
$author $article_obj->getAuthor(true);
            
$text $article_obj->getText($page);
    
            
$content art_constant("MD_CATEGORY") . ": " $category_obj->getVar("cat_title");
            if (
$text["title"]) {
                
$content .= "<br />" art_constant("MD_SUBTITLE") . ": " $text["title"];
            }
            
$source_author $author["author"];
            
$source_source $article_obj->getVar("art_source");
            if (!empty(
$source_author)||!empty($source_source)) {
                
$content .= "<br />" art_constant("MD_SOURCE") . ": " $source_author "(" $source_source ")";
            }
            if (
$article_obj->getVar("art_keywords")) {
                
$content .=    "<br />" art_constant("MD_KEYWORDS") . ": " $article_obj->getVar("art_keywords");
            }
            if (
$summary $article_obj->getSummary()) {
                
$content .=    "<br />" art_constant("MD_SUMMARY") . ": " $summary;
            }
            
$content .=    $text["body"] . "<br />";
            
$items[] = array(
                
"title"            => $article_obj->getVar("art_title"),
                
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article_obj->getVar("art_id") . "/c" $category_id,
                
"description"    => $content,
                
"descriptionHtmlSyndicated" => true,
                
"date"            => $article_obj->getTime("rss"),
                
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                
"author"        => $author["name"]
                );
            
$xml_link XOOPS_URL "/news/view.article.php" URL_DELIMITER $article_obj->getVar("art_id") . "/c" $category_id;
                
            break;
    
        case 
"category":
            
$category_obj =& $category_handler->get($category_id);
    
            if (empty(
$category_obj) || !$category_handler->getPermission($category_obj"access")) {
                
art_trackback_response(1art_constant("MD_NOACCESS"));
            }
            
$pagetitle art_constant("MD_CATEGORY");
            
$rssdesc sprintf(art_constant("MD_XMLDESC_CATEGORY"), $category_obj->getVar("cat_title"));
    
            
$criteria = new CriteriaCompo(new Criteria("ac.ac_publish"0">"));
            
$articles_obj =& $article_handler->getByCategory(
                
$category_id,
                
$xoopsModuleConfig["articles_perpage"],
                
0,
                
$criteria,
                array(
"a.art_title""a.art_time_publish""a.art_keywords""a.art_summary""a.uid""a.art_source")
            );
    
            foreach (
$articles_obj as $id => $article) {
                
$uids[$article->getVar("uid")] = 1;
            }
            
$users art_getUnameFromId(array_keys($uids));
    
            foreach (
$articles_obj as $id => $article) {
                
$content art_constant("MD_TITLE") . ": " $article->getVar("art_title"). "<br />";
                
$content .=    art_constant("MD_SUMMARY") . ": " $article->getSummary(true);
                
$items[] = array(
                    
"title"            => $article->getVar("art_title"),
                    
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article->getVar("art_id") . "/c" $category_id,
                    
"description"    => $content,
                    
"descriptionHtmlSyndicated" => true,
                    
"date"            => $article->getTime("rss"),
                    
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                    
"author"        => $users[$article->getVar("uid")]
                    );
            }
            
$xml_link XOOPS_URL "/news/view.category.php" URL_DELIMITER $category_id;
            break;
    
        case 
"author":
            
$author_name XoopsUser::getUnameFromId($uid);
            
$pagetitle art_constant("MD_AUTHOR");
            
$rssdesc sprintf(art_constant("MD_XMLDESC_AUTHOR"), $author_name);
    
            
$categories_obj $category_handler->getAllByPermission("access", array("cat_title""cat_moderator"));
            
$categories_id array_keys($categories_obj);
            if (
count($categories_id) == 0) {
                
$items = array();
                break;
            }
            
$criteria = new CriteriaCompo(new Criteria("a.uid"intval($uid)));
            
$criteria->add(new Criteria("ac.ac_publish"0">"));
            
$articles_obj =& $article_handler->getByCategory(
                
$categories_id,
                
$xoopsModuleConfig["articles_perpage"],
                
0,
                
$criteria,
                array(
"a.art_title""a.cat_id""a.art_time_publish""a.art_keywords""a.art_summary""a.art_source")
            );
            foreach (
$articles_obj as $id => $article) {
                
$content art_constant("MD_CATEGORY") . ": " $categories_obj[$article->getVar("cat_id")]->getVar("cat_title") . "<br />";
                
$content .= art_constant("MD_TITLE") . ": " $article->getVar("art_title") . "<br />";
                
$content .=    art_constant("MD_SUMMARY") . ": " $article->getSummary(true);
                
$items[] = array(
                    
"title"            => $article->getVar("art_title"),
                    
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article->getVar("art_id") . "/c" $article->getVar("cat_id"),
                    
"description"    => $content,
                    
"descriptionHtmlSyndicated" => true,
                    
"date"            => $article->getTime("rss"),
                    
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                    
"author"        => $author_name
                    
);
            }
            
$xml_link XOOPS_URL "/news/view.author.php" URL_DELIMITER $uid;
            break;
    
        case 
"index":
        default:
            
$pagetitle art_constant("MD_INDEX");
            
$rssdesc art_constant("MD_XMLDESC_INDEX");
    
            
$categories_obj $category_handler->getAllByPermission("access", array("cat_title""cat_moderator"));
            
$categories_id array_keys($categories_obj);
            if(
count($categories_id)==0){
                
$items=array();
                break;
            }
            
$criteria = new CriteriaCompo(new Criteria("cat_id""(".implode(",",$categories_id).")""IN"));
            
$criteria->add(new Criteria("art_time_publish"0">"));
            
$criteria->setLimit($xoopsModuleConfig["articles_perpage"]);
            
$articles_obj $article_handler->getAll($criteria
                array(
"art_title""uid""cat_id""art_time_publish""art_keywords""art_summary""art_source")
            );
            
            
$articles_obj =& $article_handler->getPublished(
                
$xoopsModuleConfig["articles_perpage"],
                
0,
                
$criteria,
                array(
"art_title""uid""cat_id""art_time_publish""art_keywords""art_summary""art_author""art_source")
            );
            
            foreach (
$articles_obj as $id => $article) {
                
$uids[$article->getVar("uid")] = 1;
            }
            
$users art_getUnameFromId(array_keys($uids));
    
            foreach (
$articles_obj as $id => $article) {
                
$content art_constant("MD_CATEGORY") . ": " $categories_obj[$article->getVar("cat_id")]->getVar("cat_title") . "<br />";
                
$content .= art_constant("MD_TITLE") . ": " $article->getVar("art_title") . "<br />";
                
$content .=    art_constant("MD_SUMMARY") . ": " $article->getSummary(true);
                
$items[] = array(
                    
"title"            => $article->getVar("art_title"),
                    
"link"            => XOOPS_URL "/news/view.article.php" URL_DELIMITER $article->getVar("art_id") . "/c" $article->getVar("cat_id"),
                    
"description"    => $content,
                    
"descriptionHtmlSyndicated" => true,
                    
"date"            => $article->getTime("rss"),
                    
"source"        => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/",
                    
"author"        => $users[$article->getVar("uid")]
                    );
            }
            
$xml_link XOOPS_URL "/news/";
            break;
    }
    
    
$xml_charset = empty($xoopsModuleConfig["do_rssutf8"]) ? _CHARSET "UTF-8";
    
    
$xml_handler =& xoops_getmodulehandler("xml"$GLOBALS["artdirname"]);
    
$xml $xml_handler->create($type);
    
$xml->setVar("encoding"$xml_charset);
    
$xml->setVar("title"$xoopsConfig["sitename"] . " :: " $pagetitle,"UTF-8"$xml_charsettrue);
    
$xml->setVar("description"$rssdesctrue);
    
$xml->setVar("descriptionHtmlSyndicated"true);
    
$xml->setVar("link"$xml_link);
    
$xml->setVar("syndicationURL"XOOPS_URL "/" xoops_getenv("PHP_SELF"));
    
$xml->setVar("webmaster"checkEmail($xoopsConfig["adminmail"], true));
    
$xml->setVar("editor"checkEmail($xoopsConfig["adminmail"], true));
    
$xml->setVar("category"$xoopsModule->getVar("name"), true);
    
$xml->setVar("generator"$xoopsModule->getInfo("version"));
    
$xml->setVar("language"_LANGCODE);
    
    
$dimention = @getimagesize(XOOPS_ROOT_PATH "/modules/" $GLOBALS["artdirname"] . "/" $xoopsModule->getInfo("image"));
    
$image = array(
        
"width"            => @$dimention[0],
        
"height"        => @$dimention[1],
        
"title"            => $xoopsConfig["sitename"] . " :: " $pagetitle,
        
"url"            => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/" $xoopsModule->getInfo("image"),
        
"link"            => XOOPS_URL "/news/",
        
"description"    => $rssdesc
        
);
    
$xml->setImage($image);
    
    
/*
    $item = array(
        "title" => $datatitle,
        "link" => $dataurl,
        "description" => $datadesc,
        "descriptionHtmlSyndicated" => true,
        "date" => $datadate,
        "source" => $datasource,
        "author" => $dataauthor
        );
    */
    
$xml->addItems($items);
    
    
//$dummy_content = $xml_handler->display($xml, XOOPS_CACHE_PATH."/".$GLOBALS["artdirname"].".xml.tmp");
    
$dummy_content $xml_handler->display($xml);
    
    
$tpl->assign_by_ref('dummy_content'$dummy_content);
}
//$content = ob_get_contents();
ob_end_clean();

header('Content-Type:text/xml; charset=' $xml_charset);
$tpl->display('db:system_dummy.html'$xoopsCachedTemplateId);
?>


Thanks for your help.



139
playsome
Re: Article module + short URL on xml - begging for help
  • 2009/9/10 18:11

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi,

Thanks Mamba I appreciate your kind comments about my site.

With regards to the xml.php file showing the old url's I have almost fixed it, I think.

This is probably a very dirty way of doing it but as my php knowledge is very limited this is all I could think, basically I had to hard code the shortened URL into the xml.php file like this:

I replaced all link code, for example I changed this:
"link"            => XOOPS_URL "/modules/" $GLOBALS["artdirname"] . "/view.article.php" URL_DELIMITER $article_obj->getVar("art_id") . "/c" $category_id,


into this:
"link"            => XOOPS_URL "/news/" "/view.article.php" URL_DELIMITER $article_obj->getVar("art_id") . "/c" $category_id,


It now shows the shortened url in the xml.php file as you can see here

There is however a small problem, there is an extra / in the URL, this does not cause a problem but I would like it removed, I think it has to do with URL_DELIMITER but when i removed this part it messed up the link.

I have uploaded the code from xml.php into a text file if someone could take a look at it and hopefully fix this problem. Youc an view the text file here

Thanks



140
playsome
Re: Article module + short URL on xml - begging for help
  • 2009/9/9 16:47

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hey,

I am still needing a bit of help with the xml.php and URLrewrite here is my problem.

I want to use feedburner for the rss feeds for articles on a per category basis, since the category rss works fine (rss for the index page shows old articles), however when viewing the xml file it still shows the old url's i.e it shows the /modules/ part.

Is there a way to include smarty into the xml file so that it will show the shortened URL's which where created by the xoReWriteModules hack? My only reason for wanting to do this is because if google indexes my feedburner page or xml page then there could be the same content on google but under 2 different URL's and google may penalize me for duplicate content.

I know you can create XML files with smarty but thats about it, I dont have a great deal of money but I could paypal someone $10 if the could fix this problem.

Cheers.




TopTop
« 1 ... 11 12 13 (14) 15 16 17 »



Login

Who's Online

240 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 240


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits