11
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/10 22:48

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


WOOHOO!!!!, I think i have fixed the templates not generating issue if article is installed with redmexico gui/rmcommon

In xoops_version.php I replaced:

if ($isModuleAction) {
     include_once 
dirname(__FILE__) . "/include/functions.render.php";
     
$modversion["templates"] = art_getTplPageList(""true);
 }


with:

$modversion['templates']    = array();
$modversion['templates'][1]    = array(
    
'file'          => 'article_archive.html',
    
'description'   => 'archives'
    
);
$modversion['templates'][]    = array(
    
'file'          => 'article_article.html',
    
'description'   => 'article page'
    
);
$modversion['templates'][]    = array(
    
'file'          => 'article_author.html',
    
'description'   => 'authors'
    
);
$modversion['templates'][]    = array(
    
'file'          => 'article_category.html',
    
'description'   => 'categories'
    
);
$modversion['templates'][]    = array(
    
'file'            => 'article_cparticle.html',
    
'description'    => 'article cpanel'
    
);
$modversion['templates'][]      = array(
    
'file'            => 'article_cpcategory.html',
    
'description'    => 'category cpanel'
    
);
$modversion['templates'][]    = array(
    
'file'            => 'article_cptopic.html',
    
'description'    => 'topic cpanel'
    
);
$modversion['templates'][]    = array(
    
'file'            => 'article_directory.html',
    
'description'    => 'directory'
    
);
$modversion['templates'][]    = array(
    
'file'            => 'article_inc_category.html',
    
'description'    => ''
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_inc_sponsor.html',
    
'description'    =>'sponsor text'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_inc_topic.html',
    
'descrition'    =>''
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_index.html',
    
'description'    =>'article index page'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_index_blog.html',
    
'description'    =>'blog layout'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_index_list.html',
    
'description'    =>'list layout'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_index_news.html',
    
'description'    =>'news layout'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_item_blog.html',
    
'description'    =>'bloglayout item'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_list.html',
    
'description'    =>'list of articles'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_search.html',
    
'description'     =>'search page'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_topic.html',
    
'description'    =>'topic page'
    
);
$modversion['templates'][]    = array(
    
'file'            =>'article_topics.html',
    
'description'    =>'topics'
    
);


and the templates now generate evn if redmexico gui/rmcommon is installed.

Hmm, maybe im not too bad at this programming thing afterall.

Result:
Resized Image


Well with that fixed now it just leaves the other bugs and uneeded features.

12
trabis
Re: article and tags modules, thankyou trabis
  • 2010/8/11 0:03

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

playsome wrote:
Hmm, maybe im not too bad at this programming thing afterall.


You got what you wanted, a working module, so you're not bad at all!

I suspect the problem is not related with article. The code you removed was for supporting module renaming. I noticed there are many globals involved in the process and it is very likely that the GUI is changing something it should not or including files inside functions without passing the globals around and breaking the scope.
Some times
global $something;
have different behavior than
$GLOBALS['something'];

13
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/11 17:07

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi trabis, thankyou.

I will continue testing the article module, i think the majority of bugs where posted in the original thread so there might not be many more I can find.

I will work on modifying the templates and css as thats pretty much all I can do until i start learning more about PHP and so on.

If you are still wanting to fix this module i will assist with documentation, testing ,etc.

I think once the article module is fixed and made stable and the other issues are fixed for example making it less confusing on the admin side and removing unneeded features it will be a good contender as the flagship news/article module and a step in the right direction of xoops having those killer apps i talked about.

14
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/11 21:50

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hey xoopsers,

I have made some template modifications to the article module to remove some uneeded stuff(i think anyway) and tidy them up a bit.

I have so far modified:

article_item_blog.html
article_article.html
article_index_blog.html
article_block_article.html
and templates/style.css

I have at first modified them to suit my theme slightly to see how they would look but I will try and modify so they are more general.

Some things I have modified are:

made the article image on the index page clickable to take you to the article, same with articles block the image is now clickable, on the article page I have moved the image next to the text so the text wraps around the image. removed references to trackback, etc from the tempaltes I have modified.

I have changed some class selectors to match ones used in xoops theme style.css (itemHead, itemText, itemBody, itemFoot, etc)

and I have modified CSS to add/remove margins/padding where appropriate to try and tidy things up.

I am certainly no pro with html and css so im sure someone can come up with something much better and hopefully we can get the php bugs fixed as well so it will be a 'stable' release and not an RC.

Resized Image

Article index page (blog layout)

Resized Image

Article page

Resized Image

Articles block

you can download the moddified module and templates HERE this includes the fix to xoops_version.php so that tempaltes generate if you have RMcommon/red mexico admin GUI installed.

15
trabis
Re: article and tags modules, thankyou trabis
  • 2010/8/11 22:10

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Good work but, this changes do not qualify for an RC to final version move. You should contact the author of the module proposing this changes or release your own version of the article module. If I ever touch the article module I will not do more than bug fixes.

Congratulations, I learned php and XOOPS by hacking and cloning the news module. This changes you are making in article could be just the beginning!

16
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/11 22:15

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hi trabis,

the changes I have made where not meant to be a final version, sorry for any confusion. I just wanted to share what I had done so far in the hope that someone could improve upon it. I have really only made html and css changes to templates which are probably not even that great.

I am hoping and praying that you will fix the bugs, thats all I ask so at least it will work properly and be out of RC, then hopefully another developer could work on features and things or even myself if I learn alot.

Thanks


17
trabis
Re: article and tags modules, thankyou trabis
  • 2010/8/11 23:07

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Regarding templates issue in rmcommon

article/xoops_version.php uses this line to check if module is being updated or installed:
$isModuleAction = ( !empty($_POST["fct"]) && "modulesadmin" == $_POST["fct"] ) ? true false;


This will allways return false when using rmcommon.

You need to add support for rmcommon install update by adding an extra line:
$isModuleAction = ( !empty($_POST["fct"]) && "modulesadmin" == $_POST["fct"] ) ? true false;
    
$isModuleAction = ( !empty($_POST["module"]) ) ? true $isModuleAction;


18
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/12 17:23

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


trabis, you are a genuis.

Before I added your line of code I had found another issue, although my code made the templates install and generate, the option in article preferences to use a particular themeset(none or sitewide) and the option to choose the layout template set (blog, news, list) was not available but now, thanks to your superb help it is there.

Article is now working with rmcommon installed.

Thankyou trabis, you are a legend.

19
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/12 19:08

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello,

I think i have fixed another small bug with article.

When selecting the 'blog' template the index page of article did not seem to show the xoops site name or module name in the header, I have replaced the following code in index.blog.php around line 190

$xoopsTpl -> assign("xoops_module_header"$xoopsOption["xoops_module_header"]);
$xoopsTpl -> assign("xoops_pagetitle"$xoopsOption["xoops_pagetitle"]);


with

$xoopsTpl->assign('xoops_pagetitle'$page['title'].$xoopsModule->getVar('name'));


I dont know if this is the 100% correct way to assign the pagetitle but it seems to work.

20
playsome
Re: article and tags modules, thankyou trabis
  • 2010/8/14 12:59

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello, another small fix for article module or rather the tag module but it involves editing a file in article.

The problem was when clicking an item in the tag module the URL would display as article/view.article.php?article=5 however in the article module when clicking an item link the URL would be article/view.article.php?5 notice in tag module it has extra article=, this could possibly mean duplicate content.

To fix it edit modules/article/include/plugin.tag.php line 73 and simply delete the article= so it looks liek this

"link"        => "view.article.php" URL_DELIMITER "{$item_id}",


you can also remove article= from modules/tag/plugin/article.php line 63.

Hope this helps

Login

Who's Online

452 user(s) are online (54 user(s) are browsing Support Forums)


Members: 0


Guests: 452


more...

Donat-O-Meter

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

Latest GitHub Commits