website templates

Discussion in 'General' started by ed123, Nov 12, 2019.

  1. ed123

    ed123 New Member

    Guys,

    I created a website via wordpress plugin and i want this site to be a default website for every client created.. lets say i created 3 wordpress site. i need these 3 sites as 3 default websites were user can select any of these as their site.. once they select it then all data needed(by default) will also be populated. How can i do this? pls help...
     
    Last edited: Nov 14, 2019
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Create a server side ISPConfig plugin wich attaches itself to the website insert even that copies the nescessary files when a site gets created.
     
  3. ed123

    ed123 New Member

    Sorry,, im not so sure in how to do that..please guide me..
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Find an ISPConfig developer and pay him/her to do the modification for you.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    It's not that easy to explain that in a few words, can you code in PHP?
     
  6. ed123

    ed123 New Member

    not a master but do a little..:)
     
  7. Thibaut

    Thibaut New Member

    Hello, I'm also interested in such a plugin.
    Although I'm not a PHP ninja, I have some experience deploying / customizing open source PHP solutions and also have done some Laravel development by myself.
    I am currently looking for information regarding ISPConfig plugin development, but couldn't find much until now. I reviewed the ISPConfig User Manual, but didn't seem to find anything relevant to ISPConfig plugin/modules development (did I miss it ?).
    Could you please tell me where to look in order to start learning about plugin development ?

    That could also be a possibility, could someone tell me where to reach for those developers and what budget it could represent to develop the kind of plugin @ed123 is talking about ?

    Thank you very much.
     
  8. Jesse Norell

    Jesse Norell Well-Known Member

    Existing plugins are in /usr/local/ispconfig/server/plugins-available/, so certainly refer to those. I don't know about documentation offhand, I've never tried to create one.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so let's give it a try :)

    Create a new file /usr/local/ispconfig/server/plugins-available/x_custom_apache2_plugin.inc.php

    which contains this code:

    Code:
    <?php
    
    class x_custom_apache2_plugin {
    
        var $plugin_name = 'x_custom_apache2_plugin';
        var $class_name = 'x_custom_apache2_plugin';
    
        //* This function is called during ispconfig installation to determine
        //  if a symlink shall be created for this plugin.
        function onInstall() {
            global $conf;
    
            if($conf['services']['web'] == true) {
                return true;
            } else {
                return false;
            }
    
        }
    
    
        /*
             This function is called when the plugin is loaded
        */
    
        function onLoad() {
            global $app;
    
            /*
            Register for the events
            */
    
            $app->plugins->registerEvent('web_domain_insert', $this->plugin_name, 'insert');
        }
    
    
        function insert($event_name, $data) {
            global $app, $conf;
    
            // do something here
    
    
        }
    }
    ?>
    Add your custom code in at "// do something here". You get all fields from web domain table incl. the paths in the array $data['new'], so e.g. the domain name is $data['new']['domain']

    Then activate the plugin by creating a symlink /usr/local/ispconfig/server/plugins-enabled/x_custom_apache2_plugin.inc.php that points to /usr/local/ispconfig/server/plugins-available/x_custom_apache2_plugin.inc.php
     
    Last edited: Nov 14, 2019
    Jesse Norell likes this.
  10. Thibaut

    Thibaut New Member

    Thank you both @Jesse Norell and @till...
    The given skeleton and explanation, along with an exploration of the files present under /usr/local/ispconfig/server/plugins-available/, should at least allow me to start to understand the mechanics of ISPConfig's plugins.
    I'll probably soon be back on this forum with more questions I guess ;)

    Thank you for pointing me in the correct direction.
     
  11. ed123

    ed123 New Member

    Hi,

    Thank you so much for all of these. I will try to look at it.. but if someone successfully did something like this.. would be great to share the plugin very much appreciated not just me but for whole community..
     

Share This Page