Saturday, September 26, 2015

Altering the wordpress Users Ultra Membership Plugin

The frontend user management plugin User ultra, Its well-made plugin with good options. But it is having lots of unwanted options like videos, photo gallery etc.
But it is having post management option for frontend users, in very efficient way. I wanted the plugin that allow user to submit their new posts, so i don't want even orders option in that.
Will remove unwanted things from Userultra

Altering User Ultra Dashboard (account page)

First find the php file
>wp-content/plugin/user-ultra/template/basic/dashboard.php
open it with any editor, preferably the Notepad++
From line number 188, The dashboard section will start.
User ultra untouched

To remove messages on dashboard

Begins from line number 202 (starts like this<?php if(!in_array("photos",$modules)){?>)
Remove that codes from line 299 to 217. codes shown below
<?php if(!in_array("messages",$modules)){?>
<div class="expandable-panel xoousersultra-shadow-borers" id="cp-1">
<div class="expandable-panel-heading">
<h2><?php _e('My Latest Messages','xoousers');?><span class="icon-close-open"></span></h2>
</div>
<div class="expandable-panel-content" >
<?php $xoouserultra->mymessage->show_usersultra_latest_messages($howmany);?>
</div>
</div>
<?php }?>
view raw dashboard2.php hosted with ❤ by GitHub

To remove photos on dashboard

Find and remove these much codes as below
<?php if(!in_array("photos",$modules)){?>
<div class="expandable-panel xoousersultra-shadow-borers" id="cp-2">
<div class="expandable-panel-heading">
<h2><?php _e('My Latest Photos:','xoousers');?><span class="icon-close-open"></span></h2>
</div>
<div class="expandable-panel-content">
<?php echo $xoouserultra->photogallery->show_latest_photos_private(10);?>
</div>
</div>
<?php }?>
view raw dashboard.php hosted with ❤ by GitHub

To remove My orders module

Remove these codes in dashboard.php
<?php if(!in_array("myorders",$modules)){?>
<?php if(!$xoouserultra->check_if_disabled_for_this_user($user_id, "myorders", $modules_custom_user, $modules_custom_user_id )){?>
<li><?php echo $xoouserultra->userpanel->get_user_backend_menu('myorders');?></li>
<?php }?>
<?php }?>
view raw dashboard3.php hosted with ❤ by GitHub

To remove My purchase

Remove these codes
<?php if(!in_array("wootracker",$modules)){?>
<?php if(!$xoouserultra->check_if_disabled_for_this_user($user_id, "wootracker", $modules_custom_user, $modules_custom_user_id )){?>
<li><?php echo $xoouserultra->userpanel->get_user_backend_menu('wootracker');?></li>
<?php }?>
<?php }?>
view raw dashboard4.php hosted with ❤ by GitHub

To remove My friends

Remove these codes
<?php if(!in_array("friends",$modules)){?>
<?php if(!$xoouserultra->check_if_disabled_for_this_user($user_id, "friends", $modules_custom_user, $modules_custom_user_id )){?>
<li><?php echo $xoouserultra->userpanel->get_user_backend_menu('friends');?></li>
<?php }?>
<?php }?>
view raw dashboard5.php hosted with ❤ by GitHub

To remove photos and videos

Remove these codes
<?php if(!in_array("posts",$modules)){?>
<?php if(!$xoouserultra->check_if_disabled_for_this_user($user_id, "posts", $modules_custom_user, $modules_custom_user_id )){?>
<li><?php echo $xoouserultra->userpanel->get_user_backend_menu('posts');?></li>
<?php }?>
<?php }?>
<?php if(!in_array("photos",$modules)){?>
<?php if(!$xoouserultra->check_if_disabled_for_this_user($user_id, "photos", $modules_custom_user, $modules_custom_user_id )){?>
<li><?php echo $xoouserultra->userpanel->get_user_backend_menu('photos');?></li>
<?php }?>
<?php }?>
<?php if(!in_array("videos",$modules)){?>
<?php if(!$xoouserultra->check_if_disabled_for_this_user($user_id, "videos", $modules_custom_user, $modules_custom_user_id )){?>
<li><?php echo $xoouserultra->userpanel->get_user_backend_menu('videos');?></li>
<?php }?>
<?php }?>
view raw dashboard6.php hosted with ❤ by GitHub

To use shortcodes in dashboard

just put 
<?php echo do_shortcode('[your_short_code]'); ?>
whare you have removed message and photo box in the dashboard.
This will display

one of my customization with shortcode ultimate, my cred plugins



with codes:
<?php
echo do_shortcode('
<div><hr style=" background-color: #DADADA;">
[gn_button url="http://www.autoeideas.com/my-account/?module=posts&act=add" background="#E14F10" color="#ffffff" size="6" radius="5" icon="icon: pencil-square-o" text_shadow="0px 0px 0px #000000" desc="Write a new post"]New Post[/gn_button] [gn_button url="http://www.autoeideas.com/my-account/?module=posts" background="#28a49b" color="#ffffff" size="6" radius="5" icon="icon: tasks" text_shadow="0px 0px 0px #000000" desc="Manage your posts"]Manage[/gn_button] [gn_button url="http://www.autoeideas.com/my-account/?module=profile" background="#28a49b" color="#ffffff" size="6" radius="5" icon="icon: cogs" text_shadow="0px 0px 0px #000000" desc="Upade your profile"]Profile[/gn_button]
</div>');
echo '<p><hr style=" background-color: #DADADA;"></p>';
echo '<h5 style="color:black; text-align:center; background-color: rgba(225, 79, 16, 0.14);">Points history</h5>';
echo do_shortcode('[gn_expand more_text="More" less_text="Less" height="130" link_color="#27aa91" link_style="dashed" link_align="center" more_icon="icon: arrow-circle-o-down" less_icon="icon: arrow-circle-o-up"][mycred_history][/gn_expand]');
echo '<p><hr style=" background-color: #DADADA;"></p>';
echo '<h4 style="color:black;">Recent posts</h4>';
echo do_shortcode('[gn_carousel source="posts: recent" limit="4" link="post" target="blank" height="180" items="4" scroll="2" centered="no" arrows="no" mousewheel="no"]');
?>
view raw dashboard7.php hosted with ❤ by GitHub

Adding Social login to use ultra form

If you are using social login plugin, User ultra won't includes it in it's login option. For that you need to tweak something here.

Open the php file @  wp-content/plugins/user-ultra/xooclasses/xoo.userultra.class.php with notepad++

Login form


  • find (Ctrl+F)  rememberme_
  • you will get  rememberme_ and </div>
  • after that div tag put this code (my case line no:1982)
    <div style="    height: 165px; margin-left: -50px; width: 500px;">'.do_shortcode('[oa_social_login]').'</div>
Register Form
  • find for xoouserultra-seperator-requiredfields xoouserultra-edit xoouserultra-edit-show
  • find the </div> in same line remove the '; at the end.
  • in next new line add <div style="height: 165px;">'.do_shortcode('[oa_social_login]').'</div>';
Before edit
After edit (Im running in localhost, social login icons not working)

Save and enjoy.
If you find difficulty to edit, Get the xoo.userultra.class.php file from my githib account here and replace it with original of your's.

Stuck with any problems?, Comment below.




0 comments:

Post a Comment