Elegant IPB Skin By Skinbox

TJWI: Free Hosting Support: SMF (webautosoft): Theme handling (a better way) - TJWI: Free Hosting Support

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

SMF (webautosoft): Theme handling (a better way) Don't upload your themes one by one!!!

Posted 02 March 2010 - 12:58 PM (#1) User is offline   Tom 

  • Advanced Member
  • View blog
  • Group: Administrators
  • Posts: 84
  • Joined: 14-December 07
  • software:MyBB

If you're like me, you've got better things to do with your time than deal with uploading themes one by one by one by one by one. Well, you get the idea.
Once you GET those themes uploaded, you then have to copy certain files to every directory, right? How ugly can you get.
Well, this release/upload will resolve that specific issue. Here's what this does, and how to use it.

Step 1: download the attached zip file
Step 2: download your theme(s) and extract them to your hard drive
Step 3: upload those themes to a temporary directory on your webserver, extracted.
Optionally, you can compress the entire extracted theme directory, upload it and re-extract it (it will save you time)
Step 4: unzip the attachment you downloaded from here.
Step 5: in the themes directory, you will see a file named sql_vars.inc . This is the ONLY file you will have to edit, and here's what the variables are
  • $sql_email: This is your email address. In case of problems, the system will mail you there
  • $sql_host: Your mysql host
  • $sql_user: Your mysql user
  • $sql_pass: Your mysql password
  • $sql_db: Your mysql database
  • $defaultdir: Where you store the default stuff to be copied (more on this later on)
  • $themedir: A temporary holding place for your themes (not in public_html/Themes)
  • $destdir: Where your themes will always reside (usually /home/user/public_html/Themes)

A bit more about the variables. The first ones are pretty self explanatory, but the later ones can not be so much:
Default Directory (defaultdir):
When you add things (mods, bbcode, etc) to an SMF forum, the mod will often say "Add this to your theme's default directory". Well, what they don't tell you is that if you have more than one theme, it has to be added to ALL the themes. What I did was put together an initial directory (/home/user/defaultdir) that I put this stuff in, then when done with the mod, I run theme_update.php to copy this directory, and the contents in it to all of the themes where they should be. So , my default directory looks something like that shown in the attached image.

Theme Directory (themedir):
This is my temporary theme storage directory, or where I upload themes (uncompressed) to. Once the script is run, I move the directories in here to public_html/Themes. I do things this way so that I can upload themes easily. This is necessary for the themes import script.

Destination Directory (destdir):
Where themes permamently reside. This is a necessary variable, usually something like /home/user/public_html/Themes. This is necessary for the themes import script.

Usage:
once uploaded you can call these files directly from the shell. it is NOT recommended that you upload these to the public_html directory, and it may in fact not work there. You must have SSH access.
  • Upload the enclosed files to a directory (I have mine set as /home/user/phpfiles)
  • Login via ssh
  • cd to that directory
    cd directory
    
  • use php to call the file you are wanting to use
    php filename.php
    

Files:
theme_insert.php :
This will insert the theme into your smf database so that the software will recognize it. It will also enable this on signup.
theme_update.php:
This file will copy everything from the defaults directory to all themes as appropriate. Most useful when adding things to your forums.

As always, any questions, ask away, in the support thread (where you downloaded this file from), and I'll happily answer anything I possibly can. If you need this done professionally, let me know via PM and I'll see what I can do for you.

Attached File(s)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


IPB Skins by Skinbox More Info

Enter your sign in name and password


Sign in options
Log in with Facebook Log in with Twitter   Or sign in with these services