1
Krispy
Magazine Module & Smarty
  • 2007/5/18 2:32

  • Krispy

  • Just popping in

  • Posts: 19

  • Since: 2006/7/11


I am using the Magazine module and, assuming this is a simple smarty coding issue that I can't firgure out, I would like to display the article image on the category index page.

I'm sorry, I cannot provide a link to show you because the information in my Magazine is sensitive, so hopefully I can explain it all well. If you are using Magazine, then you should hopefully understand.


The smarty code that displays the article image works on >>

xoops/modules/magazine/article.php
(this view is of the article itself)


I want the article image displayed on the page just before you get to the actual article. The page displays the list of articles in the section and is located at >>

xoops/modules/magazine/artindex.php


Of course I want the image that corresponds with the article to appear next to the link that will lead the visitor to the article.


The smarty code that displays the article image on the article is >>

<img src="<{$article.image}>">



So in a nutshell, I want the article image to show in the listing of articles and on the article page. I keep getting the dreaded X where the image should be. I'm not very familiar with how the smarty codes work, so please be very descriptive.

2
Krispy
Re: Magazine Module & Smarty
  • 2007/5/23 1:41

  • Krispy

  • Just popping in

  • Posts: 19

  • Since: 2006/7/11


I certainly do know that the path is incorrect. When I put the smarty code into the template, the path reads...

http://kustombykris.com/account/modules/magazine/


This is obviously wrong as the image is located at...

http://kustombykris.com/account/modules/magazine/images/article/image.png


I turned debug on, but I don't understand the messages and the URL's it shows are cut off at...

http://kustombykris.com/acc...


I really like this module, but some things are seriously wrong with it and its creator has vanished. It does *almost* everything I need it to do. I just want it to organize my client invoices, which it does nicely. I am attracted to the other options it has, but they don't function properly.

The permissions are messed up with it. The work effectively, but the other features of the article don't interpret them properly.

Of course there is so much that could use some tweaking. I am assuming the changes needed would each be minor for someone who knows what they are doing. If an experienced coder is willing, I will pay for upgrading this module so that all the features work the way they should. I would also be willing to explain each problem (that I have discovered) in detail to said programmer.

3
Krispy
Re: Magazine Module & Smarty
  • 2007/5/25 15:29

  • Krispy

  • Just popping in

  • Posts: 19

  • Since: 2006/7/11


Here is another thing I need changed/fixed with the module. Maybe it is simple, maybe it isn't! I'm not a coder/programmer, so I really don't know.

I have included the code from the modules/magazine/blocks/mag_spotlight.php file. This block is *supposed* to show the spotlighted articles, but it fetches the most recent article added to any category.

I need it to show up to three spotlighted articles, not one most recent article (there is the option of making the article spotlighted when it is created/edited). I also need it to only show the spotlighted articles to the members who have permissions set to view the categories the spotlighted articles are in.

Example:

Article 1 is spotlighted in category B. Member Joe can only see articles in category C, so spotlighted article 1 should not be shown to him in the block.

Here is the code from mag_spotlight.php
<?php
// $Id: mag_spotlight.php,v 1.6 2004/08/18 03:01:57 phppp Exp $
//  ------------------------------------------------------------------------ //
//                        WF-section for XOOPS                               //
//                 Copyright (c) 2005 WF-section Team                        //
//                  <http://www.wf-projects.com/>                            //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  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.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: RB                                                                //
// URL: http://singchi.no-ip.com/hack                                        //
// Project: Magazine Project                                                 //
// ------------------------------------------------------------------------- //
// Important change this to the directory path you have choosen.
include_once XOOPS_ROOT_PATH "/modules/magazine/class/common.php";
include_once 
MAG_ROOT_PATH "/include/functions.php";
include_once 
MAG_ROOT_PATH '/class/article.php';

function 
b_mag_spotlight$options )
{
    global 
$xoopsDB$xoopsUser$magPathConfig;

    
$myts = &MyTextSanitizer::getInstance();

    
$modhandler = &xoops_gethandler'module' );
    
$xoopsModule = &$modhandler->getByDirnameMODDIR );
    
$config_handler = &xoops_gethandler'config' );
    
$xoopsModuleConfig = &$config_handler->getConfigsByCat0$xoopsModule->getVar'mid' ) );

    
$block = array();
    
$block["spotlight_title"] = _MB_MAG_SPOTTITLE;
    
$block["lang_by"] = _MB_MAG_SPOTAUTORE;
    
$block["lang_read"] = _MB_MAG_SPOTREAD

    
$result $xoopsDB->query"SELECT item, image, itemlength, imagewidth, imageheight, sum_type FROM " $xoopsDB->prefixMAG_SPOTLIGHT ) . " WHERE sid = 1" );
    list ( 
$item$image$itemlength$imagewidth$imageheight$sum_type ) = $xoopsDB->fetchRow$result );

    
$item = ( $item ) ? $item MagArticle::getLastArticleByCategory();

    
$result3 $xoopsDB->query"SELECT articleid, uid, title, subtitle, maintext, summary FROM " $xoopsDB->prefixMAG_ARTICLE_DB ) . " WHERE articleid = " $item " AND changed < " time() . " AND published > 0 AND (expired = 0 OR expired > " time() . ") ORDER BY changed DESC"1);
    list ( 
$fsid$fautore$ftitle$fsubtitle$fmaintext$fsummary ) = $xoopsDB->fetchRow$result3 );

    
$block["articleid"] = intval$fsid );
    
$ftitle $myts->htmlSpecialChars$ftitle );
    
$block["articletitle"] = "<a href='" MAG_ROOT_URL "/article.php?articleid=" $block["articleid"] . "'>" $ftitle "</a>";
    
$block["author"] = mag_getLinkedUnameFromIdintval$fautore ), $xoopsModuleConfig['displayname'] , );
    
    if ( 
$image ) { 
        
$block["image"] = MAG_ARTICLEIMG_URL '/' $image;
    }
    switch ( 
trim$sum_type ) )
    {
        case 
1:
            
$maintext $subtitle;
            break;
        case 
2:
            
$maintext $fsummary ;
            break;
        case 
3:
        default:
       
$maintext $fmaintext ;
            break;
    } 
    
$spot_main_text = ($itemlength >= 1) ? mag_summarize$maintext$itemlength ) : $maintext;
    
$spot_main_text preg_replace"/(<img)(.*?)(>)/si"""$spot_main_text );
    
$block["maintext"] = $myts->displayTarea($spot_main_text);

    if ( !
is_object$xoopsUser ) )
    {
        
$block["readmore"] = "<a href="" . XOOPS_URL . "/user.php">" _MB_MAG_SPOTREAD "</a>.";
    } 
    else
    {
        
$block["readmore"] = "<a href="" . MAG_ROOT_URL . "/article.php?articleid=" . $fsid . "">" _MB_MAG_SPOTREADMORE "</a>.";;

    } 
    return 
$block;


?>

Login

Who's Online

117 user(s) are online (57 user(s) are browsing Support Forums)


Members: 0


Guests: 117


more...

Donat-O-Meter

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

Latest GitHub Commits