Remove registration form on index page and add it as a link (GoBlue Theme)

Austin Smart Posted in Theme Development 5 years ago

I need the assistance of a guru to assist me with a modification of OSSN index page (GoBlue theme). I would like to remove the registration form on the index page and add it as a link below login and Reset Password links.

Thanks for your help

Replies
French Laurent amsaleg Replied 2 years ago

Dear all.
I am trying to implement what is discussed in this thread but i find it quite confusing because I am not sure what to do in what order. Elements of discussion are all over the place and it's hard to precisely know what to patch. Some help would be much appreciated.

German Austin Smart Replied 5 years ago

Great and thanks. I will follow instructions as highlighted.

us Roman Lohov Replied 5 years ago

Now in: system/plugins/default/pages/contents/index.php Add a button between login and loss pass:

 <a href="<?php echo ossn_site_url('register');?>" class="btn btn-danger"><?php echo ossn_print('create:account'); ?></a>

This one is red color, better looking! :)

us Roman Lohov Replied 5 years ago

register.php should be like this:

<?php
/**
 * Open Source Social Network
 *
 * @package   (softlab24.com).ossn
 * @author    OSSN Core Team <[email protected]>
 * @copyright (C) SOFTLAB24 LIMITED
 * @license   Open Source Social Network License (OSSN LICENSE)  http://www.opensource-socialnetwork.org/licence
 * @link      https://www.opensource-socialnetwork.org/
 */
?>
<div class="row">
       <div class="col-md-6 col-center ossn-page-contents">
        <?php 
            $contents = ossn_view_form('signup', array(
                            'id' => 'ossn-home-signup',
                        'action' => ossn_site_url('action/user/register')
            ));
            $heading = "<p>".ossn_print('its:free')."</p>";
            echo ossn_plugin_view('widget/view', array(
                        'title' => ossn_print('create:account'),
                        'contents' => $heading.$contents,
            ));
            ?>                  
         </div>   
</div>
us Roman Lohov Replied 5 years ago

In: system/plugins/default/pages/contents/index.php You can now remove registration form, As there will be a link to Registration page:

<div class="col-md-6">
        <?php 
            $contents = ossn_view_form('signup', array(
                            'id' => 'ossn-home-signup',
                        'action' => ossn_site_url('action/user/register')
            ));
            $heading = "<p>".ossn_print('its:free')."</p>";
            echo ossn_plugin_view('widget/view', array(
                        'title' => ossn_print('create:account'),
                        'contents' => $heading.$contents,
            ));
            ?>                  
       </div>
us Roman Lohov Replied 5 years ago

In /system/plugins/default/pages/contents/user
Create a php file called "register.php". I cannot put the code here as there is a limit. So
Copy entire /system/plugins/default/pages/contents/index.php and place it in register.php you created

Now in: system/plugins/default/pages/contents/index.php Add a button between login and loss pass:

<a href="<?php echo ossn_site_url('register');?>" class="btn btn-warning"><?php echo ossn_print('create:account'); ?></a>
us Roman Lohov Replied 5 years ago

Write up "Create separate Registration Page"

Open up /libraries/ossn.lib.initialize.php

Find:

ossn_register_action('resetlogin', ossn_route()->actions . 'user/resetlogin.php');

After add:

ossn_register_action('register', ossn_route()->actions . 'user/register.php');

Find:

ossn_register_page('resetlogin', 'ossn_user_pagehandler');

After add:

ossn_register_page('register', 'ossn_user_pagehandler');

Find:

case 'login':
                        if(ossn_isLoggedin()) {

Add Before:

case 'register':
                        if(ossn_isLoggedin()) {
                                redirect('home');
                        }
                        $title               = ossn_print('create:account');
                        $contents['content'] = ossn_plugin_view('pages/contents/user/register');
                        $content             = ossn_set_page_layout('startup', $contents);
                        echo ossn_view_page($title, $content);
                        break;

Save and close.

German Austin Smart Replied 5 years ago

@Roman, When will your write up be ready? - would like to use your solution

us Roman Lohov Replied 5 years ago

I did it. At first I tryd to use Custom Pages. Damn that took forever and Even with HelloWorld I could not change echo"Hello World" to redirect me to pages/contents/register_page. That shit is messed up in there completly. They need a new write up specifically for 'WHAT TO DO WITH THAT HELLO WORLD"!

Anyway,
So I Implement the Register Page as same as the Login and Reset password pages appear. Without plugins or any other addons. Now That I have it working, I will start on a write up for other people.

German Austin Smart Replied 5 years ago

@Roman, much appreciated if you can share details with me after page has been created. Thanks