• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

HOWTO: Install all templates automatically

C

citrus

Guest
Here is a linux shell-script, which installs all available sitebuildertemplates automatically.

It parses the sourcecode of the SW-Soft template-download-page and installs all available templates.

Log on your machine, where the Sitebuilder is installed.
Create a file called templateinstaller.sh and fill it with the following code:

Code:
!#/bin/sh
# This works only on Debian!

touch source.txt
> source.txt

rm -rf index.html
wget http://www.swsoft.com/en/download/sitebuilder2/templates/

echo "Start downlading templates..."
cat index.html | grep zip |  awk '{ print $2 }' > source.txt
sed -i 's/href="//g' source.txt
sed -i 's/">ZIP//g' source.txt

mkdir tpl_zip

for DOWNLOAD in `cat source.txt`
 do
        echo ""
       wget $DOWNLOAD -P ./tpl_zip
 done

echo "Downloading finished..."

# Installing Themes

cd tpl_zip
ls *.zip > files.txt
sed -i 's/.zip//g' files.txt

mkdir files
for FILE in `cat files.txt`
 do
        unzip "$FILE".zip -d ./files/$FILE
 done

cd files

for DIR in `cat ../files.txt`
 do
        cd $DIR
        mv *.zip ../
        cd ../
 done

ls *.zip > templatelist.txt

sed -i 's/.zip//g' templatelist.txt

for TEMPLATE in `cat templatelist.txt`
 do
        unzip "$TEMPLATE".zip -d /usr/local/sitebuilder/htdocs/repository/templates/$TEMPLATE
 done

cd ../
cd ../

chown -R www-data:www-data /usr/local/sitebuilder/htdocs/repository/templates/*
# use apache:apache on Redhat Systems, or nobody:nobody on a cPanel machine (but my experiences on a cPanel system weren't good).
ls /usr/local/sitebuilder/htdocs/repository/templates/ > /usr/local/sitebuilder/htdocs/repository/templates/tmpl_inst

echo "Install complete!"
echo "you can delete the folder tpl_zip"
exit 0

Now do:

# chmod +x templateinstaller.sh
# ./templateinstaller.sh

It takes some minutes to finish.
After it's done you have to logon to the admininterface.

Hope that helps somebody.

citrus
 
A couple of errors...

chown: `www-data:www-data': invalid user

and none of the templates are added the admin section :(
 
Thanks.

Any reason why the templates do not show? What am I missing?
 
if the template directory is not owned by apache (the webuser) then the webclient can't access the direc tory and the templates don't show up.

run

chown -R apache:apache /usr/local/sitebuilder/htdocs/repository/templates/*

and see if they show up
 
Thanks, tried that - the three default ones show up fine - just none of the others :(

Thanks anway.
 
Originally posted by First Hosting
Thanks, tried that - the three default ones show up fine - just none of the others :(

Thanks anway.

do you run cpanel?
then it's nobody:nobody

what is in your /usr/local/sitebuilder/htdocs/repository/templates/ ? there should be a lot of folders.

You have to
# ls /usr/local/sitebuilder/htdocs/repository/templates/ > /usr/local/sitebuilder/htdocs/repository/templates/tmpl_inst
everytime you wan't to update your skins.
 
This might help some of you, so I thought I'd post it.

I just attempted to use this script for FreeBSD 5.3 and discovered that the version of sed on my machine doesn't like the '-i' flag without the name of a file extension to save a backup to.

I changed the sed lines as follows:

sed -i bak 's/href="//g' source.txt
sed -i bak 's/">ZIP//g' source.txt
sed -i bak 's/.zip//g' files.txt
sed -i bak 's/.zip//g' templatelist.txt

Also, FreeBSD requires the apache:apache perms, FYI.

Otherwise, it worked perfectly! Thanks!

(Note, modified to fix the sed lines)
 
Hmmm... just found a problem with this. While the script worked perfectly as far as I can see, none of the templates are showing up in their categories.

When I go into the sitebuilder interface and go to the templates section, all of the templates are listed, but their category is listed as 'none'.

Anybody know how to link the categories back up? I can see that they are in the xsl file for each template.

Any advice?
 
Back
Top