>>  Site Map >>  Forums >>  Blocks

Forum module - topics in forum:



Blocks - Having problems with a block? Code doesn't work, get help here.



Block doesnt show up, information inside topic

ok, here is my problem, i have no knowledge of php and a little of the basics of html

i downloaded a theme from the internet and completely adjusted it to my needs, besides the blocks.

The centerblocks and left blocks show up, but the right blocks doesnt

i am sure its just a theme error or something, can i send my files to someone that could help me?

i guess if you have some experience creating themes, this is probably a piece of cake

btw, is there a link where such things located are, i mean, costum blocks and themes tutorials

anyways, a decent reply is much appriciated

Very Happy






http://nukecode.com/modules.php?name=Forums&file=viewtopic&t=615




thx

i am sorry that i didnt searched for that post, i only needed to change the index text.

THX, you can remove this post if neccasairy, i mean, its kind of a spam, because i didnt searched first Razz






Seven Wrote: :
http://nukecode.com/modules.php?name=Forums&file=viewtopic&t=615


I do not understand what files you are suppose to edit for the right side block to appear on the home page. I have the metalica theme. Please help.






The call to blocks appears in theme.php in your theme folder.

If you do a search for my name you'll see a bunch of posts about blocks.






, what i find out, to show the right blocks in EVERY module,

add this, to modules.php
Code: :

define('INDEX_FILE', true);
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


you need to put it after:
Code: :

define('MODULE_FILE', true);
require_once("mainfile.php"); , which is in the beginning;


i want you to know, that this is the original modules.php, from 8.0
i am telling you this because any other version could have new codes, or another code order, so, if you have original modules.php, everything is fine..

the theme has nothing to do with the right blocks, UNLESS the theme do not support right blocks, but most of them support them, so just edit modules.php

if this doesnt work which i doubt, you need to define the index_file as what it says, you need to make the current file the index file,






Please let me clarify. On the home page, the right blocks do not show. When I click on clan roster, I can see both left & right blocks. I will try this. Thank you.






maij Wrote: :
not true, what i find out, to show the right blocks in EVERY module,

add this, to modules.php
Code: :

define('INDEX_FILE', true);
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


you need to put it after:
Code: :

define('MODULE_FILE', true);
require_once("mainfile.php"); , which is in the beginning;


i want you to know, that this is the original modules.php, from 8.0
i am telling you this because any other version could have new codes, or another code order, so, if you have original modules.php, everything is fine..

the theme has nothing to do with the right blocks, UNLESS the theme do not support right blocks, but most of them support them, so just edit modules.php

if this doesnt work which i doubt, you need to define the index_file as what it says, you need to make the current file the index file,


Oh, where do I need to add this in the modules.php?






maij Wrote: :
not true, what i find out, to show the right blocks in EVERY module,

add this, to modules.php
Code: :

define('INDEX_FILE', true);
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


you need to put it after:
Code: :

define('MODULE_FILE', true);
require_once("mainfile.php"); , which is in the beginning;


i want you to know, that this is the original modules.php, from 8.0
i am telling you this because any other version could have new codes, or another code order, so, if you have original modules.php, everything is fine..

the theme has nothing to do with the right blocks, UNLESS the theme do not support right blocks, but most of them support them, so just edit modules.php

if this doesnt work which i doubt, you need to define the index_file as what it says, you need to make the current file the index file,


Actually Horror-Code is correct... although he should have explained it better

You do NOT add to the modules.php file if you are having an issue with the right blocks not showing up issue then you need to open your /themes/my theme/theme.php file find:
Code: :
if ($index == 1) {

Comment it out.

Then add or replace it with:
Code: :
if (defined('INDEX_FILE')) {


If you are having the issue in a particular module then navigate to modules/your module/index.php and find:
Code: :
index = 1;

Comment it out

After it add:
Code: :
define('INDEX_FILE', true);







Thank you for your kind help. I got it working. Thanks again so much.






Your welcome






what i think is, this works for theme, and if theme isnt supporting right blocks,

the thing that i found out, is only for themes that already support right blocks,,

and for the ones who didnt read that well,

in modules php, right after the comments, just add it there,

Code: :
define('INDEX_FILE', true);
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);







You do not add this code as seven said to the modules.php file. That code is used by the index files to call the mainfile.php
.
Secondly there are few if any themes available for phpnuke that don't already include the right blocks. In 6+ years of dealing with phpnuke and 1000's of themes I have dealt with I have never seen a single one.

The correct and only code changes to make the right side blocks show have already been given to you by Seven (and were created by actual phpnuke developers) who has about five or more years experience dealing with php and another 3 dealing expressly with phpnuke. So why question what she says, when you have stated you have NO experience with php or phpnuke?

The code you offer is not ment to be used in the modules.php file and in fact is not a recommended fix for anything.......

To all who read this post do NOT and I can not express this enough DO NOT use this code you could end up opening unknown security holes in your site....

This code is the core code for any module not to be used in the modules.php file but as I stated in the index file of a module.

Code: :
define('INDEX_FILE', true);
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


I'll explain this code since the person who offered it doesn't know what it actually does....
Code: :
define('INDEX_FILE', true);

Defines the file as an index file... modules.php is not an index file.

Code: :
require_once("mainfile.php");

calls the mainfile.php

Code: :
$module_name = basename(dirname(__FILE__));

defines the module name... modules.php is not a module... it controls the modules.

Code: :
get_lang($module_name);

Sets the language... English, Spanish, etc.

As you can plainly see there is nothing there that calls the right blocks.

So once again lets review.. there are few if any themes that don't have right side blocks... so with that said and as Seven described.. if you have no right blocks in any module

Open themes/theme_name/theme.php and find:
Code: :
if ($index == 1) {


Replace it with:
Code: :
if (defined('INDEX_FILE')) {


If you look at the theme.php file from any theme, generally in the "function themefooter() {" section you will find something that says
Code: :
blocks("right");

This would be the code to call the right blocks....

Topic Locked




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS