• I’m trying to figure out how to implement the advanced login for the skysa toolbar.

    You can find out more about it at https://www.skysa.com

    This is the script they provide as a guideline to feed login information to the bar. This is allows for seamless login to the chat room and instant messaging feature. This script is placed into the footer to call the user information to the bar.

    <script type="text/javascript">
    var _SKYAUTH = {
    loginUrl:'REPLACE WITH FULL LOGIN URL',
    memberNick:'REPLACE WITH CONTEXT CODE TO GET MEMBER USER NAME',
    memberId:'REPLACE WITH CONTEXT CODE TO GET MEMBER ID',
    profileUrl:'REPLACE WITH MEMBER PROFILE URL',
    photoUrl:'REPLACE WITH MEMBER PHOTO URL'
    };
    </script>

    This is what I’ve come up with so far, but I don’t know anything about php or how wordpress handles function calls

    <script type="text/javascript">
    var _SKYAUTH = {
    loginUrl:'https://xxxxx.com/wp-login.php',
    memberNick:'<?php echo wp_get_current_user( $display_name ) ?>',
    memberId:'<?php echo wp_get_current_user( $user_id ) ?>',
    profileUrl:'<?php echo wp_get_current_user( $user_url ) ?>',
    photoUrl:''
    };
    </script>

    I spent time digging through the codex, but I haven’t been able to hack together anything accidentally. I think I’m using the correct functions but I’m pretty sure that my syntax is totally screwed up. I’d love for some help from any one who has experience with login calls and passthroughs. I’ve had working on other, older software (Simple Machines Forum), so I know there is a way, I just don’t know how to wrangle wordpress into working with this.

Viewing 1 replies (of 1 total)
  • Thread Starter Prometheus Fire

    (@prometheus-fire)

    I thought about this some more, perhaps someone with some php skills could implement the current user calls directly into the Skysa plugin. That would be more efficient anyhow and should have been done in the first place when they developed the plugin. The entire plugin is a single php file.

    Here’s the code for it:

    <?php
    /*
    Plugin Name: Skysa Appbar
    Plugin URI: https://www.skysa.com
    Description: Skysa appbar settings plugin
    Version: 1.0
    Author: Skysa
    */
    
    add_action('get_footer', 'filter_footer');
    add_action('admin_menu', 'skysa_config_page');
    
    function filter_footer() {
        $skysa_toolbarid = get_option('SkysaAppbarID');
        $skysa_enabled = get_option('SkysaAppbarEN');
    
        if ($skysa_toolbarid != '' and $skysa_enabled) {
            echo '<script src="https://static2.skysa.com/?i='.$skysa_toolbarid.'" type="text/javascript"></script>';
        }
    }
    
    function skysa_config_page() {
        add_submenu_page('themes.php', __('Skysa Configuration'), __('Skysa Configuration'), 'manage_options', 'skysa-key-config', 'skysa_config');
    }
    
    function skysa_config() {
        $skysa_toolbarid = get_option('SkysaAppbarID');
        $skysa_enabled = get_option('SkysaAppbarEN');
    
        if ( isset($_POST['submit']) ) {
            if (isset($_POST['toolbarid']))
            {
                $skysa_toolbarid = $_POST['toolbarid'];
                if ($_POST['skysa_enabled'] == 'on')
                {
                    $skysa_enabled = 1;
                }
                else
                {
                    $skysa_enabled = 0;
                }
            }
            else
            {
                $skysa_toolbarid = '';
                $skysa_enabled = 0;
            }
            update_option('SkysaAppbarID', $skysa_toolbarid);
            update_option('SkysaAppbarEN', $skysa_enabled);
            echo "<div id=\"updatemessage\" class=\"updated fade\"><p>Skysa settings updated.</p></div>\n";
            echo "<script type=\"text/javascript\">setTimeout(function(){jQuery('#updatemessage').hide('slow');}, 3000);</script>";
        }
        ?>
        <div class="wrap">
            <h2>Skysa Appbar for WordPress Configuration</h2>
            <div class="postbox-container">
                <div class="metabox-holder">
                    <div class="meta-box-sortables">
                        <form action="" method="post" id="skysa-conf">
                        <div id="skysa_settings" class="postbox">
                            <div class="handlediv" title="Click to toggle"><br /></div>
                            <h3 class="hndle"><span>Skysa Settings</span></h3>
                            <div class="inside">
                                <table class="form-table">
                                    <tr><th valign="top" scrope="row"><label for="toolbarid">Skysa Appbar On/Off:</label></th>
                                    <td valign="top"><input type="checkbox" id="skysa_enabled" name="skysa_enabled" <?php echo ($skysa_enabled ? 'checked="checked"' : ''); ?> /> <label for="skysa_enabled">Enable or disable the Skysa Appbar</label><br/></td></tr>
                                    <tr><th valign="top" scrope="row"><label for="toolbarid">Skysa Appbar ID:</label></th>
                                    <td valign="top"><input id="toolbarid" name="toolbarid" type="text" size="20" maxlength="40" value="<?php echo $skysa_toolbarid; ?>"/></td></tr>
                                </table>
                            </div>
                        </div>
                        <div class="submit"><input type="submit" class="button-primary" name="submit" value="Update Appbar &raquo;" /></div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <?php
    }
    ?>

    As you can see, it is fairly short compared to many. I wonder if there is a way to combine the needs of the integration script above with the plugin file itself.

Viewing 1 replies (of 1 total)
  • The topic ‘Skysa toolbar advanced login’ is closed to new replies.