Welcome to Geeklog, Anonymous Thursday, January 09 2025 @ 05:20 am EST
Geeklog Forums
Homepage Only blocks - again
beavis82
Anonymous
Hello everyone,
I know this has been mentioned here before, but when searching the archives I couldn't find an answer to this problem. Basically I'm trying to display a normal block on the homepage only. If I set the block to show on a section page, or on all pages, it displays properly. However, if I set it to display on the homepage only, it just doesn't show up.
Initially I thought this might have been a daft problem with the server I was running (RaQ3) but I've since installed Geeklog on a new Zeus server with up-to-date PHP and mySQL and I'm getting the same problem.
I'm currently running GeekLog v1.3.7sr1 - I had the same problem with the previous version of Geeklog, v1.3.6 i think? The block I am trying to create just contains plain text.
Anyone have any ideas? It seems a few people here have experienced this, but nobody seems to be admitting that there's a problem! Thanks in advance!
S
11
8
Quote
Anonymous
Anonymous
This was a problem in 1.3.6 but has since been corrected in 1.3.7. I have no problems at all in creating blocks for the homepage only.
Are you sure you're running the latest Geeklog version and have the block enabled? If so, you need to give step by step details on exactly what you're doing so this can be recreated.
10
12
Quote
Anonymous
Anonymous
I'm having the same problem with 1.3.7sr1. I've installed this on two different systems, and it works fine on one system (RH7.1) but not the other (FreeBSD). So, perhaps there's something about the system that confuses GeekLog as to whether it is displaying the home page. Both are running PHP 4.1.2, so that's probably not the culprit. In any case, it does seem to be a system-dependent bug.
12
9
Quote
Anonymous
Anonymous
Many people who ask for help don't give enough details or provide their complete setup configurations. Because of this, it's tough to tell if it's an operator error or a system specific problem.
Why don't all those who are still having this problem list what your configurations are so the developers can see if there's a common link there.
9
11
Quote
beavis82
Anonymous
This is all the info I can find:
-----------------------------------------
New system - belongs to my ISP. Homepage Only blocks don't show. Here's the PHPINFO:
System: Linux **server name hidden** 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown
Build Date Dec 16 2002 17:24:00
Configure Command './configure' '--with-mysql' '--with-gd' '--with-ttf' '--with-jpeg' '--enable-force-cgi-redirect' '--enable-ftp' '--enable-bcmath'
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/bin/php.ini
Debug Build no
Thread Safety disabled
mySQL version: 3.23.51
Not too sure what the server physically is, all I know is it runs Zeus 3.4
-----------------------------------------
Old server: RaQ3 - Homepage Only blocks don't show on this server either:
System Linux **server name hidden** 2.2.14C10 #3 Wed Jun 21 15:05:10 JST 2000 i586 unknown
Build Date Mar 23 2001
Configure Command './configure' '--with-mysql'
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib
ZEND_DEBUG disabled
Thread Safety disabled
mySQL version: 3.22.32
The server is a bog-standard RaQ3 - with PHP4 and mySQL installed.
If there's anything else you need to know, or if this is completely the wrong info, please let me know!
s
10
14
Quote
Anonymous
Anonymous
This may shed some light on your situation with homepage-only blocks...
I found the reason why homepage-only blocks are showing up on one server but not the other. It is because of the way the web servers are set up. The FreeBSD server is set up with a PHP-CGI wrapper, so instead of ending with "index.php", the script name is something like "/cgi-sys/php-cgiwrap/username/php4.cgi". This never matches the expected "index.php" so the homepage-only block never shows up.
I will describe how I discovered this and how I fixed it.
I created a debugging block to output the contents of $HTTP_SERVER_VARS['SCRIPT_NAME']. Here is the code for it that you can put in lib-custom.php:
function phpblock_debugblock()
{
global $HTTP_SERVER_VARS;
$retval .= 'SCRIPT_NAME=' . $HTTP_SERVER_VARS['SCRIPT_NAME'] . "<br>";
return $retval;
}
That's how I found out what Geeklog is "seeing" in terms of the name of the script that is running.
It turns out that the problem concerns the following code in the COM_showBlocks function (not COM_showBlock) of lib-common.php:
if(( $HTTP_SERVER_VARS['SCRIPT_NAME'] <> $pathonly[1] . "/index.php" ) OR !empty( $topic ) OR ( $page > 1 ) OR $newstories )
{
$sql .= " AND (tid = 'all' AND type <> 'layout')";
}
else
{
$sql .= " AND (tid = 'homeonly' OR (tid = 'all' AND type <> 'layout'))";
}
I changed the if statement to:
if( !empty( $topic ) OR ( $page > 1 ) OR $newstories )
and that fixed the problem.
I wonder if we really don't need to have the ( $HTTP_SERVER_VARS['SCRIPT_NAME'] <> $pathonly[1] . "/index.php" ) part, since that result never really changes anyway? Or is it meant to cover some situation that I don't know about?
Hope this helps...
fwoomp
27
13
Quote
Anonymous
Anonymous
Good job! I hope Dirk or one of the other developers sees this and takes note.
11
12
Quote
beavis82
Anonymous
Cheers matey - that's done the trick! Thanks, you're a star!
S
11
29
Quote
Anonymous
Anonymous
This sorta fixed the problem..
Although this block which I *only* wanted in the homepage now also appears on my staticpages =(
Its just some other mod pages that it doesn't show up on.
9
9
Quote
Anonymous
Anonymous
Yup same here. Is there another workaround that makes it just show up on the homepage?
14
10
Quote
Roderick
Anonymous
Thank you for this solution. That is some nice work you did here.
Regards,
Roderick
10
11
Quote
All times are EST. The time is now 05:20 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content