Skip to Content.
Sympa Menu

lyceum-users - [Lyceum-users] Rv: Private Themes

lyceum-users AT lists.ibiblio.org

Subject: Lyceum-users mailing list

List archive

Chronological Thread  
  • From: Tirso Peralta Camacho <tirso_peralta AT yahoo.com>
  • To: Lyceum <lyceum-users AT lists.ibiblio.org>
  • Subject: [Lyceum-users] Rv: Private Themes
  • Date: Tue, 27 Feb 2007 11:39:08 -0800 (PST)




Now I can have private themes but only with one owner, later i will try to do it for  more than one owner.
I've changed the following files:
* lib/wp-includes/functions.php
    1. Around line 1748  ( function get_theme_data() ) add the following lines:

       if ( preg_match("|Blog Owner:(.*)|i", $theme_data, $bOwner) )
        $blog_owner = trim( $bOwner[1] );
    else
        $blog_owner = "all";
   
    2. Next in the return array of the function get_theme_data add a key like this 'Blog Owner' => $blog_owner.
   
    3. Go to  get_themes() function right after get_theme_data() function, look for the following lines:

        $theme_data = get_theme_data("$theme_root/$theme_file");
        $name = $theme_data['Name'];
        $title = $theme_data['Title'];
        $description = wptexturize($theme_data['Description']);
        $version = $theme_data['Version'];
        $author = $theme_data['Author'];
        $template = $theme_data['Template'];
      
       and add this line:
       $blog_owner = $theme_data['Blog Owner'];

   
in the same get_themes() function look for this line:

    $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot);

and add the following key to the array: 'Blog Owner' => $blog_owner

* lyceum/wp-admin/themes.php
    Around line 76 add this line of code:
    $owner = $themes[$theme_name]['Blog Owner'];
   
   
two lines after that add this one:
$currentSlug = $wpdb->get_var("SELECT slug FROM $wpdb->blogs WHERE id = '$blogdata->id'");

   
right after that add this line:

if ( ( $owner == $currentSlug ) || ( $owner == "all" ) ){

   
then look for this line

<?php } // end foreach theme_names ?> and add a } like this <?php }} // end foreach theme_names ?>

That's it for the files that can get it all done, now we need to add an owner to the theme

* lyceum/wp-content/<your-theme>/style.css
    To add an owner to the theme just add a line to the header in the style.css of your theme that you want to be private, a line that should look like this:

Blog Owner: slugname

where slugname is the slug of the blog that owns the theme  

PD: if you want your themes to be public just don't add the Blog Owner line in style.css, remember is in the header of this file that begin with /* and end with */.

That's it!, this is for those who wants the theme can be only show for one user and not for all of them, i will try to make it for a lager number of users.

Sorry for my english, i hope you get the idea

For more info  contact me:

e-mail: tirso_peralta AT yahoo.com

Let me know what you think

"Feel free to share"
----- Mensaje original ----
De: John Joseph Bachir <jjb AT ibiblio.org>
Para: Tirso Peralta Camacho <tirso_peralta AT yahoo.com>
CC: Lyceum <lyceum-users AT lists.ibiblio.org>
Enviado: martes, 27 de febrero, 2007 2:57:43
Asunto: Re: [Lyceum-users] Private Themes


On Thu, 22 Feb 2007, Tirso Peralta Camacho wrote:

> Hi, i need to change the state of the themes, i want to make a theme public or private, because i want the suscribers use some of the themes and not all of them, how can i get it done?, any ideas?
> I tried to change two files which are functions.php in lib/wp-includes and themes.php in lyceum/wp-admin, but without any result.

Tirso-

I can't think of an easy way to do this, sorry. If you do come up with a
solution, it would be great if you could document it on the wiki.


--
John Bachir
http://lyceum.ibiblio.org/
http://blog.johnjosephbachir.org/
aim/yim/msn/jabber.org/gtalk: johnjosephbachir
713-494-2704
irc://irc.freenode.net/lyceum


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

  • [Lyceum-users] Rv: Private Themes, Tirso Peralta Camacho, 02/27/2007

Archive powered by MHonArc 2.6.24.

Top of Page