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.30.01 RN All Other Issues
Author Message
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Tue May 26, 2009 7:17 am Reply with quote

Just a a quick idea , But I'm looking forward to change the theme for the administration part.
The idea behind that is to have a different theme when you access admin.php , I know blocks can be removed via the themes/Your_Theme/theme.php , but the overall function is in mainfile.php

this is what I added in get_theme() ,
Code:
if ('ADMIN_FILE') $theme = 'Ravenice';


I tested this it works , but now I want to push it further , to control from the admin pannel rather than hardcoded.
in SQL added Admin_Theme in nuke_config
in mainfile.php
Code:
if ('ADMIN_FILE') $theme = '$Admin_Theme';


basicly I added a new language friendly field in settings , how can I recall this field in mainfile.php?
 
View user's profile Send private message Visit poster's website MSN Messenger
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue May 26, 2009 9:07 am Reply with quote

In mainfile.php at/around lines 172,173, you will see this code which reads all the field/column names/values from the `config` table (settings) into the $nuke_config array.
Code:
$result = $db->sql_query("SELECT * FROM `".$prefix."_config` LIMIT 0,1");

$nuke_config = $db->sql_fetchrow($result);


In mainfile.php at/around lines 234-237 you will see examples of how to read the array values:
Code:
$sitename = $nuke_config['sitename'];

$nukeurl = $nuke_config['nukeurl'];
$site_logo = $nuke_config['site_logo'];
$slogan = $nuke_config['slogan'];
// etc.


So you would then access your new field value like this (note the change from what you had). This also assumes you have properly escaped the value and verified that the person is an admin. I leave that up to you Wink
if (is_admin($admin)) $theme = $nuke_config['Admin_Theme'];
 
View user's profile Send private message
bluerace
Regular
Regular



Joined: Apr 04, 2009
Posts: 85
Location: Behind you

PostPosted: Tue May 26, 2009 9:26 am Reply with quote

Basically, bbtonuke should switch admin CP in the same theme-name templates automatically.

But there is no call ThemeSelect to bring up admin templates in phpnuke themes/forums/templates/YOUR-THEME-NAME.

very long time ago, we did in order to keep the template consistency. However, it was discarded.

IF you want, tell me to post the codes. I will find it from my backup.
However, it will ask you to add corresponding templates under modules/forums/templates folder.

As you see if you browse phpBB2 styles, some phpBB2 styles have their own admin templates, others not.

For instance, if your theme is fisubice, look at the phpBB2 template of fisubice (not modification by Daz for phpnuke) then you will find admin templates (I don't remember exactly).

Then, the change a couple of lines in default config file in bbtonuke (forums module) will bring up admin cp in corresponding templates.

_________________
Make stupid PHP-NUKE Smart, that's my favorite chore in Enteripse PHP-Nuke 
View user's profile Send private message Visit poster's website
eldorado







PostPosted: Tue May 26, 2009 11:26 am Reply with quote

Ok , thanks raven. I was looking somewhere else Very Happy
But what I was suggesting is that it only occurs in admin.php not when you are browsing as admin the rest of the CMS.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other 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 ©