Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Wed Oct 29, 2008 7:10 pm Reply with quote

When trying to use the "show" function in the blocks admin it just redirects to index.php. Note this just happens when using the RavenIce theme.

After some testing I figured out it is because BLOCK_FILE is undefined. It seems that what ever module/admin area you are in BLOCK_FILE is undefined. So there for the security check at the top of each block will kick you to the index. If you switch to any of the other stock themes BLOCK_FILE is magicly redefined. Obviously this is a theme issue, but after looking at it for severl hours I am unable to figure out why.

I know I could fix this by insertig another define for BLOCK_FILE, but I would think that is not the best solution.
 
View user's profile Send private message
jestrella
Moderator



Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic

PostPosted: Wed Oct 29, 2008 8:21 pm Reply with quote

Does this happen with every block you try to show on admin panel when using RavenIce theme????

_________________
"For those whom have not reach the sky... Every mountain seems high"

Best Regards
Jonathan Estrella
http://about.me/jestrella04 
View user's profile Send private message Visit poster's website
Palbin







PostPosted: Wed Oct 29, 2008 9:02 pm Reply with quote

Yes because BLOCK_FILE is undefined so the check at the top of each block file fails and you are redirected to index.php.
 
jestrella







PostPosted: Wed Oct 29, 2008 9:31 pm Reply with quote

Ok I was able to replicate your issue. And here's a temp fix:

open up file /admin/modules/blocks.php and find at line 360 (assuming virgin code)

Code:
function block_show($bid) {


after that add...

Code:
if(!defined('BLOCK_FILE')) {define('BLOCK_FILE', true);}


So it end up like this...

Code:
function block_show($bid) {

   if(!defined('BLOCK_FILE')) {define('BLOCK_FILE', true);}
   global $prefix, $db, $admin_file;
 
Palbin







PostPosted: Wed Oct 29, 2008 9:36 pm Reply with quote

Yeah that is basicly what I did to make it work also, but obviously not the best. Smile
 
jestrella







PostPosted: Wed Oct 29, 2008 9:40 pm Reply with quote

I will take a deeper shot at this... will keep you informed
 
jestrella







PostPosted: Wed Oct 29, 2008 10:03 pm Reply with quote

Well, I think this is related to how the theme render the blocks. As I can see there no blocks shown when the admin's block_show() function takes place (when using RavenIce theme). In others themes if the right blocks are loaded first then this will show up with no issue.

Thoughts????
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Oct 29, 2008 10:31 pm Reply with quote

Fix seems good to me.
jestrella - can you create a Mantis issue for this (RN2.3.01) ?
 
View user's profile Send private message Send e-mail
jestrella







PostPosted: Wed Oct 29, 2008 10:33 pm Reply with quote

said and done
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Fri Nov 28, 2008 5:46 pm Reply with quote

This is a result of RavenIce incorporating this logic: $hide_blocks_left = array();

The logic that is used to implement this feature no longer uses the blocks('left'); call in function themeheader(). Even more bewildering is the fact that the code if(!defined('BLOCK_FILE')) {define('BLOCK_FILE', true);} was in the 2.20.01 release but somewhere along the line got "lost" so adding it back in makes perfect sense.
 
View user's profile Send private message
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Wed Dec 17, 2008 7:12 am Reply with quote

I'm not sure if this is the same issue...
My right side blocks are working fine if they are defined for Registered Users.

When I try to set a block for All Visitors, then the blocks fail and don't show for Anonymous, only after logging in do they show up.

I'm using a custom 'Join Form' module, which becomes the index.php for my not logged in users. They get no right side blocks no matter what theme I have set as default.

I tried the above fix. It didnt' work for me.
Is there something I need to add to the module index.php?? Or is there something missing in my custom block files? I have this at the beginning...
Code:


if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}


Perhaps that Location:../index.php ??? which is refers to the root index.php?? And as the index.php that anonymous sees is not in the root ?????

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©