21
middleton
Smartsection: item image on first page only
  • 2006/12/31 18:56

  • middleton

  • Just popping in

  • Posts: 30

  • Since: 2006/12/21


This is a hack for Smartsection 2.12. It changes the display format so that the item image only displays on the first page. I find it useful on long documents that I've paginated using [pagebreak] -- this way, the image only appears on the first page.

Step 1: edit item.php

Around line 104, you'll see this code:
$xoopsTpl->assign('pagenav', $pagenav->renderNav());

Just below it, add this line:
$xoopsTpl->assign('curpage'$item_page_id);


Step 2: edit /templates/smartsection_item.html

Look for this line:
<{if $item.image_path}>

Modify it to this:
<{if $item.image_path && $curpage == 0}>


That should do it! Now, the image will only show up on the first page.

Brad



22
middleton
Re: auto-replace block title with graphic (update!)
  • 2006/12/31 5:02

  • middleton

  • Just popping in

  • Posts: 30

  • Since: 2006/12/21


Here I was trying to come up with this hack tonight, with not much luck. But after a search here, I realized I posted the same hack a couple of years ago under my old account (BradM)! I think I've lost some brain cells.

Anyway, I'm using XOOPS 2.0.16 and here's how to implement this old hack. Of course, back up the necessary files before modifying them!!

Step 1: edit /class/theme_blocks.php
In function buildBlock, just before the line $block = array(, add the following code:
/* hack to auto-replace block titles with graphics */
// get the block title
$imgttl $xobject->getVar'title' );
// replace spaces with underscores
$imgttl str_replace(" ""_"$imgttl);
// remove non-alphanumeric characters
$imgttl preg_replace("(W)"""$imgttl);
// convert to lower case
$imgttl mb_convert_case($imgttlMB_CASE_LOWER"UTF-8");
// append image format
$imgttl $imgttl.".gif";
// build paths
$imgpath XOOPS_THEME_PATH.'/THEMEDIR/images/'.$imgttl;
$imgurl XOOPS_THEME_URL.'/THEMEDIR/images/'.$imgttl;
// check for file
if (file_exists($imgpath)) {
    
$ttl_img $imgurl;
}
else { 
$ttl_img ""; }
/* end hack */

Here I'm using the path/url to a single theme directory ("THEMEDIR"). There must be a way to stick a XOOPS variable in here to make this applicable to all themes, but I don't know what it is.

Next, under 'lastmod' => $xobject->getVar( 'last_modified' ), add the following line:
'ttl_img' => $ttl_img,


Step 2: edit /themes/THEMEDIR/theme.html
Put the following code where ever you would like to activate this switch. I only have it functioning on the right-hand column, so I've put this code where the right-hand blocks are generated. You need to replace <{$block.title}> with the following:
<{if $block.ttl_img}>
    <
img src="<{$block.ttl_img}>" alt="<{$block.title}>" title="<{$block.title}>">
<{else}>
    <{
$block.title}>
<{/if}>

Step 3: upload your title graphics (in GIF format, all lower case) into /themes/THEMEDIR/images/.
Name them to match your titles, replacing spaces with underscores. For example, "User Menu" becomes "user_menu.gif". If the script can't find the file, it'll just add the text version.

That should do it. For some reason, this doesn't work on anything with an apostrophe (such as "Who's Online") -- and I cannot figure out why. I think XOOPS converts the apostrophe to unicode (or whatever it's called) so maybe that's why?

Brad



23
middleton
Feeback Request
  • 2006/12/22 6:16

  • middleton

  • Just popping in

  • Posts: 30

  • Since: 2006/12/21


Hello Xoopsers...

I'm currently porting my old html/cgi-based site to Xoops. It's been offline for a while, so I thought I'd take the time to do it right before going public again.

It's a fan site for horror, namely those fanged creatures of the night. You can visit it at:

http://www.vampyres.com/crypt

Seeing as it's offline, please log in with test/test. Any feedback is appreciated. I'm still tweaking the main theme, as well as the modules. I'm also attempting to wrangle Amazon's astore as part of it too, just to give visitors another reason to stay -- I'm not looking to retire on the commissions.

It's a little too "cheery" for a horror site, but it's not meant to have dripping blood graphics everywhere either. That was back in the mid-90's.

Brad



24
middleton
DHTML pagination & Xoops
  • 2006/12/22 2:25

  • middleton

  • Just popping in

  • Posts: 30

  • Since: 2006/12/21


Hello,

I've been experimenting a bit with dhtml pagination and Xoops, specifically with the idea of breaking up long documents.

I was attempting to integrate the following from dynamic drive:
http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm

However, I can't seem to get the pagination to work; all the rest of the dhtml seems to be fine.

Has anyone had any success with auto-paginating long documents in Xoops?

Brad



25
middleton
i-menu 2.2 RC1 bug
  • 2006/12/21 13:23

  • middleton

  • Just popping in

  • Posts: 30

  • Since: 2006/12/21


Hi, has anyone else seen this?

I'm using i-menu version 2.2 RC1, it installed great. The parent menues all display fine. However, only the first sub-menu displays; if there are other sub-menues, they are not output to the page.

For example, I have it set up as:

PARENT1
>>SUB1
PARENT2
PARENT3
>>SUB3
PARENT4
>>SUB4

And only sub1 is showing.

I checked the html source and the i-menu script is essentially bypassing any subsequent sub-menues after building the first one, as there is no sign of them in the html.

Any ideas?
Brad




TopTop
« 1 2 (3)



Login

Who's Online

221 user(s) are online (106 user(s) are browsing Support Forums)


Members: 0


Guests: 221


more...

Donat-O-Meter

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

Latest GitHub Commits