1
solaris365
'Recent News' block only on Index-page of WF-Channel?
  • 2006/4/30 8:58

  • solaris365

  • Just popping in

  • Posts: 22

  • Since: 2004/8/8 8


XOOPS Version: 2.0.9
Module Name/Version:WF-Channel 1.07
PHP Version: 4
XOOPS Setting: Module for start page: WF-Channel !!!

My Question: How can I have the 'Recent News' block (News Module, v1.4) only on Index-page of WF-Channel, but hide it on any other sub-page of the WF-Channel module? Example:

YES, ON index page:
-------------------
/modules/wfchannel/

BUT NOT on 'sub-pages' like e.g.:
----------------------------------
/modules/wfchannel/index.php?pagenum=1
/modules/wfchannel/index.php?pagenum=2
/modules/wfchannel/index.php?pagenum=3
or
/modules/wfchannel/index.php?op=link
/modules/wfchannel/index.php?op=refer

My idea would be a check of the current URL within the template file 'news_block_top.html' for the 'Recent News' block.
If the current URL is exactly == "/modules/wfchannel/", than display, otherwise do not display the Recent News block.

Exists a similar Hack like this already?
If not, in which variable i can find the current URL to check whether the current page is "/modules/wfchannel/" or "/modules/wfchannel/index.php?pagenum=1"?

2
Quest
Re: 'Recent News' block only on Index-page of WF-Channel?
  • 2006/4/30 12:23

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Check the blocks admin and set the Recent block to where you want it to show on.

3
solaris365
Re: 'Recent News' block only on Index-page of WF-Channel?
  • 2006/5/1 15:27

  • solaris365

  • Just popping in

  • Posts: 22

  • Since: 2004/8/8 8


Thank Quest. This I did, but it was not enough.
Meanwhile I wrote a small Hack that does the trick.

At the end of the function b_news_top_show() in the file news_top.php of the News-Module I check the name of the directory the current module (here: 'wfchannel') and the combination of get-params.

If it indicates that the current page is the index-page I do nothing (1), but if the get-params indicate the its a subpage I empty the array with the new content (2), with the result that the news block remains empty/is not shown.

if ( $xoopsModule->getVar('dirname') == 'wfchannel') {

   if ( empty(
$_GET) || 
     (
$_GET['sel_lang'] && !$_GET['pagenum']) ) {
          
// ([b]1[/b]) let is pass to display
   
} else {
          
$block = Array(); // ([b]2[/b]) EMPTY BLOCK => NO NEWS
   
}
}

Login

Who's Online

164 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 164


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