1
Dylian
WF-Books HACK
  • 2009/5/12 16:08

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


A few days ago "TOON2009" contacted me with the question if i wanted to edit wfbooks for him so he could show a thumbnail in the new books and top books block. (i will post the layout he wanted to have below).

I've failed to do this, so thats why I'm posting it here.

Can someone please edit wf-books whit the above features. (thumbnail an author year.. added in the blocks)

Greets Dylian.

The layout (the words in the fields are dutch):

Resized Image
Dylian.eu | Webdevelopment
| http://dylian.eu |

Dylian Melgert | Home
| http://me.dylian.eu |

Arcus College Shedule Notification Service
| http://arcus.dylian.eu |

2
Catzwolf
Re: WF-Books HACK
  • 2009/5/12 16:18

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


wf-Books?

Link to this module please?

3
Dylian
Re: WF-Books HACK
  • 2009/5/12 16:27

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Dylian.eu | Webdevelopment
| http://dylian.eu |

Dylian Melgert | Home
| http://me.dylian.eu |

Arcus College Shedule Notification Service
| http://arcus.dylian.eu |

4
Dylian
Re: WF-Books HACK
  • 2009/5/18 17:08

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


I fixed it myself (with some code from MC Donald).

For everyone who needs the same:

Replace the content of "modules/wfbooks/blocks/wfbooks_top.php" with:
/**
 * $Id: wfbooks_top.php v 1.00 21 June 2005 John N Exp $
 * Module: WF-links
 * Version: v1.0.3
 * Release Date: 21 June 2005
 * Developer: John N
 * Team: WF-Projects
 * Licence: GNU
 */
if (!defined('XOOPS_ROOT_PATH')) {
    die(
'XOOPS root path not defined');
}
/**
 * controleerBlockgroups()
 * 
 * @param integer $cid
 * @param string $permType
 * @param boolean $redirect
 * @return 
 **/
function controleerBlockgroups$cid 0$permType 'WFBookCatPerm'$redirect false ) {
    global 
$xoopsUser;

    
$groups is_object$xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
    
$gperm_handler = &xoops_gethandler'groupperm' );

    
$module_handler = &xoops_gethandler'module' );
    
$module = &$module_handler -> getByDirname'wfbooks' );

    if ( !
$gperm_handler -> checkRight$permType$cid$groups$module -> getVar'mid' ) ) ) {
        if ( 
$redirect == false ) {
            return 
false;
        } else {
            
redirect_header'index.php'3_NOPERM );
            exit();
        } 
    } 
    unset( 
$module );
    return 
true;


/**
 * Function: b_mylinks_top_show
 * Input   : $options[0] = date for the most recent links
 *                            hits for the most popular links
 *                   $block['content'] = The optional above content
 *                   $options[1]   = How many links are displayes
 * Output  : Returns the most recent or most popular links
 */
function b_wfbooks_top_show$options ) {
    global 
$xoopsDB;

    
$block = array();
    
$modhandler = &xoops_gethandler'module' );
    
$wflModule = &$modhandler -> getByDirname"wfbooks" );
    
$config_handler = &xoops_gethandler'config' );
    
$wflModuleConfig = &$config_handler -> getConfigsByCat0$wflModule -> getVar'mid' ) );

    
$wfmyts = &MyTextSanitizer :: getInstance();

    
//$result = $xoopsDB -> query( "SELECT lid, cid, title, date, hits FROM " . $xoopsDB -> prefix( 'wfbooks_links' ) . " WHERE published > 0 AND published <= " . time() . " AND (expired = 0 OR expired > " . time() . ") AND offline = 0 ORDER BY " . $options[0] . " DESC", $options[1], 0 );
    
$result $xoopsDB -> query"SELECT lid, cid, title, date, hits, uitgever, schrijver, isbn, screenshot FROM " $xoopsDB -> prefix'wfbooks_links' ) . " WHERE published > 0 AND published <= " time() . " AND (expired = 0 OR expired > " time() . ") AND offline = 0 ORDER BY " $options[0] . " DESC"$options[1], );
 
    while ( 
$myrow $xoopsDB -> fetchArray$result ) ) {
        if ( 
false == controleerBlockgroups$myrow['cid'] ) || $myrow['cid'] == ) {
            continue;
        } 
        
$linkload = array();
        
$title $wfmyts -> htmlSpecialChars$wfmyts ->stripSlashesGPC($myrow["title"]) );
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if ( 
strlen$myrow['title'] ) >= $options[2] ) {
                
$title substr$myrow['title'], 0, ( $options[2] -) ) . "...";
            } 
        } 
        
$linkload['id'] = intval($myrow['lid']);
        
$linkload['cid'] = intval($myrow['cid']);
        
$linkload['title'] = $title;
        if ( 
$options[0] == "date" ) {
            
$linkload['date'] = formatTimestamp$myrow['date'], $wflModuleConfig['dateformat'] );
        } elseif ( 
$options[0] == "hits" ) {
            
$linkload['hits'] = $myrow['hits'];
        } 
        
$linkload['dirname'] = $wflModule -> getVar'dirname' );
        
$linkload['screenshot'] = $myrow['screenshot'];
        
$linkload['screenshots_dir'] = $wflModuleConfig['screenshots'];
        
$linkload['uitgever'] = $myrow['uitgever'];
        
$linkload['schrijver'] = $myrow['schrijver'];
        
$linkload['isbn'] = $myrow['isbn'];
        
$linkload['boek_url'] = XOOPS_URL."/modules/".$linkload['dirname']."/singlelink.php?cid=".$linkload['cid']."&lid=".$linkload['id'];
        
// Begin taalvariables
        
$linkload['lang_title'] = _MB_WFB_TITLE;
        
$linkload['lang_uitgever'] = _MB_WFB_UITGEVER;
        
$linkload['lang_schrijver'] = _MB_WFB_SCHRIJVER;
        
$linkload['lang_isbn'] = _MB_WFB_ISBN;
        
// Eind taalvariables        
        
        
$block['links'][] = $linkload;
    } 
    unset( 
$_block_check_array );
    return 
$block;


/**
 * b_wfbooks_top_edit()
 * 
 * @param $options
 * @return 
 **/ 
function b_wfbooks_top_edit$options ) {
    
$form "" _MB_WFB_DISP " ";
    
$form .= ";
    if ( 
$options[0] == "date" ) {
        
$form .= "date'";
    } else {
        
$form .= "hits'";
    } 
    
$form .= " />";
    
$form .= "$options[1] . "' /> " _MB_WFB_FILES "";
    
$form .= _MB_WFB_CHARS $options[2] . "' /> " _MB_WFB_LENGTH "";
    return 
$form;


?>


and replace the content of "modules/wfbooks/templates/blocks/wfbooks_block_new.html" with:
<table width="auto" id="nieuwste_boeken" border="0" onclick='document.location="<{$linkload.boek_url}>"'>
 <
tr>
 <{foreach 
item=linkload from=$block.links}>
    <{if 
$linkload.screenshot != ""}>
     <
td id="screenshot" width="auto" style="font-weight: bold; text-align: left; vertical-align: top; padding-left: 8px;">
      <
a href="<{$linkload.boek_url}>">
       <
img src="<{$xoops_url}>/<{$linkload.screenshots_dir}>/<{$linkload.screenshot}>" width="100px" border="0" />
      a
     td>
    <{/if}>
     <
td id="boek_infol" width="auto" style="font-weight: bold; text-align: left; vertical-align: top; padding-left: 8px;">
      <
a href="<{$linkload.boek_url}>">
       <{if 
$linkload.uitgever != ""}><{$linkload.lang_uitgever}><br /><{/if}>
       <{if 
$linkload.title != ""}><{$linkload.lang_title}><br /><{/if}>
       <{if 
$linkload.isbn != ""}><{$linkload.lang_isbn}><br /><{/if}>
       <{if 
$linkload.schrijver != ""}><{$linkload.lang_schrijver}><{/if}>
      a
     td>
     <
td id="boek_infoc" width="auto" style="font-weight: bold; text-align: left; vertical-align: top; padding-left: 8px;">
      <
a href="<{$linkload.boek_url}>">
       <{if 
$linkload.uitgever != ""}>:<br /><{/if}>
       <{if 
$linkload.title != ""}>:<br /><{/if}>
       <{if 
$linkload.isbn != ""}>:<br /><{/if}>
       <{if 
$linkload.schrijver != ""}>:<{/if}>
      a
     td>
     <
td id="boek_infor" width="auto" style="font-weight: bold; text-align: left; vertical-align: top; padding-left: 8px; border-right: 3px dotted #000000;">
      <
a href="<{$linkload.boek_url}>">
       <{if 
$linkload.uitgever != ""}><{$linkload.uitgever}><br /><{/if}>
       <{if 
$linkload.title != ""}><{$linkload.title}><br /><{/if}>
       <{if 
$linkload.isbn != ""}><{$linkload.isbn}><br /><{/if}>
       <{if 
$linkload.schrijver != ""}><{$linkload.schrijver}><{/if}>
      a
     td>
 <{/foreach}>
 tr>
table>


And as last replace the content of "modules/wfbooks/templates/blocks/wfbooks_block_top.html" with:

<table id="meest_gelezen_boeken" border="0">
    <
tr>
    <{foreach 
item=linkload from=$block.links}>
        <{if 
$linkload.screenshot != ""}>
            <
td id="screenshot">
                <
a href="<{$linkload.boek_url}>">
                    <
img src="<{$xoops_url}>/<{$linkload.screenshots_dir}>/<{$linkload.screenshot}>" width="100px" border="0" />
                a
            td>
        <{/if}>
    <{/foreach}>
    tr>
table>


Greets Dylian.
Dylian.eu | Webdevelopment
| http://dylian.eu |

Dylian Melgert | Home
| http://me.dylian.eu |

Arcus College Shedule Notification Service
| http://arcus.dylian.eu |

Login

Who's Online

299 user(s) are online (217 user(s) are browsing Support Forums)


Members: 0


Guests: 299


more...

Donat-O-Meter

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

Latest GitHub Commits