Midrub

Midrub / Template documentation


Introduction

  • Item Name : Midrub
  • Author : Scrisoft

First of all, we want to Thank You for choosing Midrub platform. We hope that you will be satisfied by this platform. Also, we promise to improve it, to add new features and to fix the bugs. You will be able to update for FREE to a newer version, whenever a it will be available.

This documentation contains the essential steps to install the platform. Also, it contains detailed information about each feature of the Midrub platform.

Requirements:

  1. PHP 5.6.
  2. MySQL database.
  3. FTP Client (eg: FileZilla)

If there are any difficulties installing or configuring the Midrub platform, please contact us.

How to install Midrub? #back to top

Midrub can be installed and configured in 2 minutes. Just follow the video bellow to understand how to install and configure it easily.

Download Midrub platform and extract all files from Midrub-app folder, compile it on server. 2. Create MySQL data base and import this SQL code:

CREATE TABLE IF NOT EXISTS `ci_sessions` (
  `id` varchar(40) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `timestamp` int(10) unsigned NOT NULL DEFAULT '0',
  `data` blob NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `activity` (
  `activity_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `net_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `body` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `network_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `network_id` bigint(20) NOT NULL,
  `created` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `followed` tinyint(1) NOT NULL,
  `view` tinyint(1) NOT NULL,
  PRIMARY KEY (`activity_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7159 ;

CREATE TABLE IF NOT EXISTS `activity_meta` (
  `meta_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `activity_id` bigint(20) NOT NULL,
  `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `net_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `author_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `author_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `body` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `parent` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `network_id` bigint(20) NOT NULL,
  `created` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `view` tinyint(1) NOT NULL,
  PRIMARY KEY (`meta_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=279078 ;

CREATE TABLE IF NOT EXISTS `comments` (
  `comment_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `comment` varchar(300) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`comment_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ;

CREATE TABLE IF NOT EXISTS `networks` (
  `network_id` int(3) NOT NULL AUTO_INCREMENT,
  `network_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `net_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(11) NOT NULL,
  `user_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_avatar` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `date` datetime NOT NULL,
  `expires` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `token` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `secret` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `completed` tinyint(1) NOT NULL,
  PRIMARY KEY (`network_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=171 ;

CREATE TABLE IF NOT EXISTS `notifications` (
  `notification_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `notification_title` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `notification_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `notification_body` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `sent_time` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `template` tinyint(1) NOT NULL,
  `template_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`notification_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;

INSERT INTO `notifications` (`notification_id`, `notification_title`, `notification_name`, `notification_body`, `sent_time`, `template`, `template_name`) VALUES
(1, 'Welcome to [site_name]', 'Welcome message(without confirmation)', '

You can login here: [login_address]

Using this username and password:

Username: [username]

Password: *** Password you set during signup ***

Cheers!

The [site_name] Team


', '', 1, 'welcome-message-no-confirmation'), (2, 'Welcome to [site_name]', 'Welcome message(with confirmation)', '

To activate your account and verify your email address,

please click the following link: [confirmation_link]


', '', 1, 'welcome-message-with-confirmation'), (3, 'Your account has been activated', 'Success confirmation message', '

Congratulations, your account has been activated!

You can login here: [login_address]

Using this username and password:

Username: [username]

Password: *** Password you set during signup ***

Cheers!

The [site_name] Team

', '', 1, 'success-confirmation-message'), (4, 'Password Reset', 'Reset password message', '

Dear [username]

To reset the password to your [site_name]''s account, click the link below:

[reset_link]

', '', 1, 'password-reset'), (5, 'Your password has been reset successfully', 'Success password changed message', '

Congratulations, your account has been activated!

You can login here: [login_address]


', '', 1, 'success-password-changed'), (6, 'Your message wasn''t published successfully', 'Publishing message error', '

You messagge wasn''t published successfully on a social network.

You can login here: [login_address]

', '', 1, 'error-sent-notification'), (7, 'Resend Confirmation Email', 'Resend confirmation email', '

To activate your account and verify your email address,

please click the following link: [confirmation_link]

', '', 1, 'resend-confirmation-email'), (8, 'Your new account was created successfully', 'Send password to new users', '

A new account has been created for you on [site_name].

You can login here [login_address]

Username: [username]

Password: [password]

', '', 1, 'send-password-new-users'), (9, 'Scheduled Notification', 'Scheduled notification', '

An user has scheduled a new message.

Please Sign In: [login_address]


', '', 1, 'scheduled-notification'), (12, 'New user registration', 'New user registration', 'A new user has registered at [site_name]', '', 1, 'new-user-notification'); CREATE TABLE IF NOT EXISTS `notifications_stats` ( `stat_id` bigint(20) NOT NULL AUTO_INCREMENT, `notification_id` bigint(20) NOT NULL, `user_id` int(11) NOT NULL, `status` tinyint(1) NOT NULL, PRIMARY KEY (`stat_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `options` ( `option_id` bigint(20) NOT NULL AUTO_INCREMENT, `option_key` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `option_value` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`option_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=266 ; CREATE TABLE IF NOT EXISTS `payments` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `txn_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `payment_amount` decimal(7,2) NOT NULL, `payment_status` varchar(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `plan_id` varchar(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ; CREATE TABLE IF NOT EXISTS `plans` ( `plan_id` int(6) NOT NULL AUTO_INCREMENT, `plan_name` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `plan_price` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `currency_sign` char(3) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `currency_code` char(3) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `network_accounts` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `rss_feeds` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `publish_accounts` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `publish_posts` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `features` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `period` bigint(10) NOT NULL, PRIMARY KEY (`plan_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; INSERT INTO `plans` (`plan_id`, `plan_name`, `plan_price`, `currency_sign`, `currency_code`, `network_accounts`, `rss_feeds`, `publish_accounts`, `publish_posts`, `features`, `period`) VALUES (1, 'Free Plan', '0.00', '$', 'USD', '1', '1', '1', '20', '1 Social Profiles\n1 Feed Rss\nReal-time Analytics\nMessage Scheduling\n', 365); CREATE TABLE IF NOT EXISTS `posts` ( `post_id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `body` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `title` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `url` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `img` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `video` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `category` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `sent_time` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `ip_address` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL, `view` tinyint(1) NOT NULL, PRIMARY KEY (`post_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2686 ; CREATE TABLE IF NOT EXISTS `posts_meta` ( `meta_id` bigint(20) NOT NULL AUTO_INCREMENT, `post_id` bigint(20) NOT NULL, `network_id` bigint(20) NOT NULL, `network_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `sent_time` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL, PRIMARY KEY (`meta_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2612 ; CREATE TABLE IF NOT EXISTS `rss` ( `rss_id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `rss_name` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `rss_url` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `publish_description` tinyint(1) NOT NULL, `publish_url` tinyint(1) NOT NULL, `networks` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `enabled` tinyint(1) NOT NULL, `completed` tinyint(1) NOT NULL, `added` datetime NOT NULL, `pub` tinyint(1) NOT NULL, PRIMARY KEY (`rss_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=103 ; CREATE TABLE IF NOT EXISTS `rss_posts` ( `post_id` bigint(20) NOT NULL AUTO_INCREMENT, `rss_id` bigint(20) NOT NULL, `user_id` int(11) NOT NULL, `networks` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `title` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `url` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `published` datetime NOT NULL, `scheduled` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`post_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1349 ; CREATE TABLE IF NOT EXISTS `urls` ( `url_id` bigint(20) NOT NULL AUTO_INCREMENT, `original_url` text CHARACTER SET utf8 NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`url_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=207 ; CREATE TABLE IF NOT EXISTS `urls_stats` ( `stats_id` bigint(20) NOT NULL AUTO_INCREMENT, `url_id` bigint(20) NOT NULL, `network_name` varchar(30) CHARACTER SET utf8 NOT NULL, `color` varchar(30) CHARACTER SET utf8 NOT NULL, `ip_address` varchar(30) CHARACTER SET utf8 NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`stats_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=188 ; CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `email` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `password` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `role` tinyint(1) NOT NULL, `status` tinyint(1) NOT NULL, `date_joined` datetime NOT NULL, `last_access` datetime DEFAULT NULL, `ip_address` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `reset_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `activate` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2430 ; INSERT INTO `users` (`user_id`, `username`, `email`, `password`, `role`, `status`, `date_joined`, `last_access`, `ip_address`, `reset_code`, `activate`) VALUES (104, 'administrator', 'admin@example.com', '$2a$08$CwRg961g2QCS1kBjA0NgAOs8Dg31QzOP6mNxF.OdrCd5BqAmtLyOe', 1, 1, '2016-08-11 10:37:16', '2016-10-10 15:41:16', '', ' ', ''), (118, 'testuser', 'user@email.com', '$2a$08$fcmlgRj56zPvpYvAc3v9Ze8Tp4xX7cKmoSJZOhEqTIjvZmFtdfu/O', 0, 1, '2016-10-10 12:37:03', '2016-10-10 15:41:36', '', ' ', ''); CREATE TABLE IF NOT EXISTS `users_meta` ( `meta_id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `meta_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `meta_value` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`meta_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=420 ;

Open config.php file from application/config/ and replace the http://www.examle.com/ with your website address, also replace Midrub with your site name. Add your contact email (will be used as expeditor for sent messages) and notification email where you will receive the system notifications.

Open file database.php from application/config/ folder and add the server address to the created data base, the name of the data base, user and password.

After you have accomplished the steps above, you have to configure the platform, so you can connect social networks to make posts. Next you will find detailed information about how to configure each social network.

You can login on your website with username: administrator and password: 12345678 as admin.

If you prefer the SQL File, you can download it from here SQL File

Why I can't Sign In?

There maybe several reasons why you can't Sign In:

  1. Open the application/config/config.php file and ensure $config['base_url'] and $config['login_url'] contains the full url with slash(/). Also, ensure, $config['cookie_domain'] has the value: .domain.com(you need the same value if you have installed midrub in a subdirectory).
  2. Ensure you have uploaded .htaccess in the main Midrub's directory.
  3. Ensure you enter the same url you have in the address bar. If you have there will ssl or www, the url in the address bar must be the same. For this purpose you can use the code from htaccess to redirect always to the right url.

After installation and configuration, you have to update from the admin panel. You will find more information bellow: How to Update Midrub Automatically?


Social Networks #back to top

Here are the steps how to obtain an Api Key and how to configure Midrub platform so you can make posts on social networks.

The callback url for al social networks is https://www.yourwebsite.com/user/callback/nameofnetwork

The callback must be exactly like in the config.php file. With ssl or www. After the full url, must be user/callback/(name of social networks with lowercase)


Facebook

  1. Login here: https://developers.facebook.com/
  2. Mouse over My apps button and click Add a New App.
  3. Choose platform: website.
  4. Click on Skip and Create App ID
  5. Fill up the form.
  6. After the application was created with success, click on Settings and afterwards Basic.
  7. Click on Add Platform and add your website.
  8. Copy Application ID also App secret and add them in Networks>Facebook.
  9. Enter again Facebook Developer, app settings and click App Review.
  10. Click Make App Public.
  11. Click Start a Submission.
  12. Chose publish_actionspermission.
  13. Follow next instructions here, to get publish_actions permission ( follow all steps to be approved ).

Facebook Groups and Facebook Pages

  1. Use the same Facebook's Application ID and App secret. Also, you need to have these permissions manage_pages, publish_pages and user_managed_groups.

Flickr

  1. Go here https://www.flickr.com/services/apps/create/apply/ and register an application. Then, copy the Key and Secret and add in Networks>Flickr.

Twitter

  1. Login here: https://apps.twitter.com/
  2. Click on Create New App.
  3. Fill up the form.
  4. In settings tab, uncheck option: Enable Callback Locking.
  5. If you want to use Twitter for login/sign up, you need permission to get user’s email.
  6. Fill up the form here: https://support.twitter.com/forms/platform, to get permission to obtain user’s email.
  7. After getting permission, click Regenerate Consumer Key and Secret button and copy the new Api Key and Api Secret, paste them in Networks>Twitter.

VK

  1. Login here: https://vk.com/apps?act=manage
  2. Click on Создать приложение.
  3. Fill up the form.
  4. Click on Настройки.
  5. Copy ID приложения and Защищенный ключ, paste in Networks>VK.

Blogger

  1. When you create your application, you register it with Google. Google then provides information you'll need later, including a client ID and a client secret.
  2. Activate the Blogger API in the Services panel of the Google APIs Console.
  3. Then, add your Client ID, Client Secret, Api Key and Application Name in Networks>Blogger.

Linkedin

  1. Click on the My Apps link to manage your LinkedIn applications.
  2. From here, you can create a new application if you don't already have one, or view the details of your existing applications. 
  3. You will find your Client ID (otherwise known as API Key/ID or Consumer Key/ID) listed in the "Authentication" side nav link, underneath the header "Authentication Keys".
  4. Then, add your Client ID and Client Secret in Networks>Linkedin.

Linkedin Companies

  1. Click on the My Apps link to manage your LinkedIn applications.
  2. From here, you can create a new application if you don't already have one, or view the details of your existing applications. 
  3. You will find your Client ID (otherwise known as API Key/ID or Consumer Key/ID) listed in the "Authentication" side nav link, underneath the header "Authentication Keys".
  4. Then, add your Client ID and Client Secret in Networks>Linkedin Companies.
  5. The Callback for Linkedin Companies is https://www.yourwbsite.com/user/callback/linkedin_companies

Medium

  1. Click on the New Application link and create an application.
  2. Then, add your Client ID and Client Secret in Networks>Medium.

Pinterest

  1. Go to https://developers.pinterest.com/apps/ and click on the button Create app to create a new application.
  2. Fill in the form and copy the Api ID and Api Secret.
  3. Then, add your Api ID and Api Secret in Networks>Pinterest.

Tumblr

  1. Go to https://www.tumblr.com/oauth/apps and Register a new application.
  2. Then, add your OAuth Consumer Key and Secret Key from Tumblr in Networks>Tumblr.

Wordpress

  1. Go to https://developer.wordpress.com/apps/ and click on the button Create New Application.
  2. Then, add your Client ID and Client Secret in Networks>Wordpress.

Instagram

  1. Just Enable it from Networks>Instagram.

Reddit

  1. Go to https://www.reddit.com/prefs/apps and click on the button create another app.... Create your app. Copy the client_id and copy client_secret.
  2. Then, add your Client ID and Client Secret in Networks>Reddit.

Youtube

  1. When you create your application, you register it with Google. Google then provides information you'll need later, including a client ID and a client secret.
  2. Activate the YouTube Data API v3 in the Services panel of the Google APIs Console.
  3. Then, add your Client ID, Client Secret, Api Key and Application Name in Networks>Youtube.

Google Plus

  1. When you create your application, you register it with Google. Google then provides information you'll need later, including a client ID and a client secret.
  2. Activate the Google+ API and Google+ Domains API in the Services panel of the Google APIs Console.
  3. Then, add your Client ID, Client Secret, Api Key and Application Name in Networks>Google Plus.

Dailymotion

  1. Create a new account or login using your own account on Dailymotion.
  2. Register your application on your developer profile. You will retrieve an API key and an API secret.
  3. Then, add your API key and API secret in Networks>Dailymotion.

Vimeo

  1. Go to https://developer.vimeo.com/apps
  2. Create a new application. You have to request Upload Access from Vimeo for your created application.
  3. After your development application is approved, go in your Vimeo Application and click on the tab Authentication.
  4. Add your Your Callback URLs: http://yourwebsite.com/user/callback/vimeo
  5. Copy Client Identifier and Client Secrets. Then paste them in Midrub Installation -> Admin Panel -> Networks -> Vimeo

If you need help with configuration of the social networks, please, watch the videos here https://www.midrub.com/tuts.html


Libraries #back to top

Gshorter

Gshorter it's a library developed by us, to be used for shortening URLs. This library its based on Google Shorter. To use it, go to https://console.developers.google.com/ and register a new application, copy the key and insert it in the config.php file. If you insert the key, the URL addresses will be shortened automatically.


Bcrypt

Portable PHP password hashing framework adapted for CodeIgniter by Dwight Watson. http://www.github.com/studiousapp/codeigniter-bcrypt.

This library is used to encrypt the user’s passwords on Midrub.


Security#back to top

Description of the security methods to prevent attacks such as: SQL injection, XSS, Hijacking sessions and others.

SQL injection

We have used only query bidings and as you can read here https://www.codeigniter.com/userguide3/database/queries.html, the values are automatically escaped, producing safer queries.

XSS Filtering

We have enabled XSS protection by added $config['global_xss_filtering'] = TRUE; in the application/config/config.php file.

You can read more here https://www.codeigniter.com/user_guide/libraries/security.html

CSRF Filtering

We have enabled CSRF protection by added $config['csrf_protection'] = TRUE; in the application/config/config.php file. Also, we have used the form helper for each forms.

You can read more here https://www.codeigniter.com/user_guide/libraries/security.html

Session hijacking

We added $config['sess_use_database'] = TRUE; in the application/config/config.php file and all sessions are saved in the database.

Why there is NO captcha for login and sign up forms?

Because after three failed attempts to login, the user is blocked for one hour. Once registered/signed up, the ip address is stored and the user will not be able to register/sign up again for 24 hours. Also you can choose, that it will not be possible to register/sign up ever, from the same ip address. This way, we simplified the login and sign up steps, without being necessary to complete other fields.


How to add another social network? #back to top

For publishing posts:

In application/interfaces/ folder you’ll find Autopost.php file, it’s a file which contains an interface for classes from application/autopost/. It’s only necessary to create a new file in application/autopost/ folder, which will contain the class with the interface from Autopost.php. Afterwards, open main_helper.php file, from application/helpers/. And add the code below to the function generate_user_statstics:

    
                    if(array_key_exists("socialnetworks", $posts[$current_date]))
					{
						$d .= ", socialnetworks: " .$posts[$current_date]["socialnetworks"]. "";
					}
					else
					{
						$d .= ", socialnetworks:0";						
					}
                            

In style.css file from assets/user/css/ folder, it’s possible to add custom style for the added social network.

In posts.js file from assets/user/js/ folder, it’s possible to add the social networks’s icon to the socialIcon function, which will appear on history page.

Login

At the moment there are two social networks through which you could login/sign up. But you can add more social networks for login/sign up.

To add a new social network for, it’s necessary to add a new class in application/login/ folder, which must have Login interface from application/interfaces/ folder.

The callback url for login for al social networks is https://www.yourwebsite.com/callback/nameofnetwork

Features and Midrub's files #back to top

Midrub consists of three main sections.Here you will find the detailed description and files of each section :

1. Sign in/Sign up and password reset

The Sing in, Sign up and password reset is developed from scratch, by us. It does not contain captcha, because after three failed attempts, the log in page is blocked for an hour(for this is used a session). You can reset the password once per day. The sign up is possible once per day (if the admin chooses this option) for each IP address or by default, never from the same IP address.

When the user writes the password, there is an option to remember the session. If the option is not selected, the session will be deleted after two hours. If there is a dynamic IP address, the session will be deleted automatically when you are reconnected to the internet.

At sign up the user can not use spaces for username or password. Also, the email and username will be verified if they are valid. The password and the username must contain 6 characters. If the admin chooses the user to confirm his email after sign up, then, at login the user will be redirected to a page to request a new message for email confirmation. The request is allowed once per day.

The sign up/login through a social network account (ex: Facebook, Twitter and others), allows the user to sign up/login with just one click. At sign up the user is asked the permission to publish posts on the social network used for sign up/login, too. In this case, the username for account will contain the first letter of the social network and after dot (.) the user's id. This method avoids the username to be occupied/in use, because the basic sign up does not allow the username to contain dots (.).

Files
  • application/controllers/Auth.php - is responsible for controlling the flow of the authentication, registration, password reset and new password functions.
  • application/models/User.php - contains functions to insert new user in database, check username and password on database, request a password reset and change the current password. Also, this model is used for user management and edit user data.
  • application/helpers/alerts_helper.php - contains all success and unsuccessful messages.
  • application/views/auth - contains all view files which displays the pages login, signup, password reset and new password. Also, there you will find view files which displays the Privacy Policy, Terms and conditions and Report a bug pages.
  • assets/auth - contains all javascript and css files for the login, signup, password reset and new password page.
  • The library application/libraries/Bcrypt.php is used for hashing the password.
  • The index function from application/controllers/Auth.php displays all configured social networks from the application/login folder.


2. Admin's account

In admin's account you can the stats about every user (how many have signed up in the last week, month or trimester). Also, the amount of posts published on each social network and the last 5 registered users. In application/helpers/main_helper.php you will see the function generate_admin_statstics how to generate the stats about the number of registered users recently. And in application/controllers/Adminarea.php file, at the dashboard function, you will see functions the show stats about the amount of published posts and last registered users.

On Scheduled posts page you will the number of scheduled posts to be published. The date of the first unpublished post and the date of the last post to be published. If you do not want or do not have the possibility to use Cron Job, you could use Only unpublished button, to publish the posts which were not published as scheduled. Publish all button will publish all posts that were not published as scheduled, as well the posts scheduled to be published later (it works only if the page was open in the browser all time long).

To use Cron Job for scheduling posts use */1 * * * * wget --spider http://www.yourwebsite.com/admin/publish-scheduled/1/ >/dev/null 2>&1 command.

Feeds

  • This is how the feed works for now. The application/helpers/rss_helper.php file contains a RSS Feed reader. First, it checks if the feed can be read and returns the content, then the user can save the feed. After the feed is saved, the user is redirected to the RSS feed page where he can activate the reading of RSS feed, can choose on which social networks it will be published and to see the published posts.
  • For reading and publishing RSS feeds you have to use this Cron Job:
  • */1 * * * * wget --spider http://www.yourwebsite.com/admin/publish-rss/1 >/dev/null 2>&1 >/dev/null 2>&1 Soon, we will launch an update, only for RSS feed, which will allow you to choose the posts from a RSS feed to be published automatically or manual, when and where to be published each post.

Notifications page consists of 2 parts:

  • - First, possibility to write custom messages, which are sent as notifications by email, when a new user is registered, the password is reseted, notification about errors of the published posts, notifications from admin, notifications about scheduled posts, notifications about new members and etc. We use templates imported through SQL, you can edit them with Summernote.
  • - Second, possibility to send to users notifications. Users will the notifications in their account or in their email if they choose to receive notifications by email. As admin you can choose the notifications do not be sent by email.

Users - all registered users. You can delete user's account, to change his status or to block account. Search engine makes easier to find an user. Click New User button to register a new member. As option, you could choose to send to the new user the password and username by email.

Networks - all configured social networks, which can be deactivated for basic users. If there is no social network configured, you can find in the top detailed information how to configure them.

Plans - initially you have a single plan as all users. You can limit the amount of accounts, of RSS feeds and the amount of posts per month. You can modify the specifications for each plan and it's active period. You can add/delete an unlimited amount of plans.

Settings - notifications options, activate/deactivate certain options/functions of the platform. Easy to upload an icon, favicon or an image/video for main background page. If a video is uploaded as background, refresh the page and you can upload an image as cover for background video. Cover image is important, because web browsers as Internet Explorer plays the video with 2 seconds delay and on mobile devices the background video format could not be supported.

Settings > Payments - if you want to activate the paid subscription, connect to PayPal and Identity Token. Go to https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-website-payments. Turn On the Auto Return option. For Return URL insert the address where the user will be redirected: https://www.yourwebsite.com/user/plans. Turn ON Payment Data Transfer option. Copy the Identity Token and save it in Settings > Payments.

FAQ - answers to questions about admin's content.

Files
  • application/controllers/Adminarea.php - is responsible for controlling the flow of the all Admin pages and functions.
  • application/models/Notifications.php - is used to insert new notification, update an existing template and get a notification/template from database.
  • application/models/Options.php - is used to get, save and delete an option from database.
  • application/helpers/alerts_helper.php - contains all success and unsuccessful messages from admin area.
  • application/helpers/main_helper.php - contains the functions generate_admin_statstics, admin_header, get_option and publish(to publish sheduled posts) which are used for Admin area.
  • application/views/admin - contains all view files which displays the pages Dashboard, Update, Scheduled, Notifications, Users, New User, Networks, Settings and FAQ.
  • application/views/admin/layout - contains the layout's files for Admin pages.
  • assets/admin - contains all javascript and css files for the pages Dashboard, Update, Scheduled, Notifications, Users, New User, Networks, Settings and FAQ.
  • update.php - the file that contains the update of the platform, checks if it has the permission to copy files on server, makes a backup file for each which is going to be updated, after that downloads the necessary file for update. If for any reason the update can not be downloaded, it will restore the old version from backup. If the update is successful, the update.json file will be uploaded on server, this will help to cancel the update and to go back to the old version of the platform. Every file will be restored from backup folder and update.json file will be deleted.


3. User's account

When user enter his account, first are displayed the stats about published posts. Also, the last 5 posts. In application/helpers/main_helper.php file, you can find generate_user_statstics function to see how stats of the published posts are generated.

In the top of each page, there are 2 icons:

  • - icon the number of received notifications. Click it and you will see the last 10 notifications. Click See all to see all received notifications. You can read and delete them. Notifications are sent by admin, only after the user is registered.
  • - icon shows if any of the posts was not published. Click it and you will see the last 10 posts. Red icon indicates that a post was not published on one or several social networks.

On Posts page you can make posts and to see the last published posts. A post can contain an unlimited amount of characters. The posts can contain HTML tags (if you want to write an article), but some could be blocked for security reasons. URL and Photo field, allows to share links and images on social networks. After you have inserted a web site link, it's important to click button, this way get_site function from application/helpers/main_helper.php folder will extract the content necessary for making a preview of the link inserted. Also this preview will be used on the social networks selected for publishing the post. If the admin allows users to upload images on server, the user can upload an image for the post with just one click.

For now, you can upload video files for Facebook and Twitter, only. A video file should not be more than 10 MB and it will be uploaded on the server. Soon we will add more social networks on which you could publish a video file. If you want a video to be published/shared on Twitter, it should not exceed the duration of 30 seconds and has to be MP4 format.

The post can be published immediately or by clicking on this icon, you can schedule it for being published at the desired time. The message can saved in drafts. Later you can copy it by clicking on it in the right side of the page.

If you select blogging platform for publishing, also you can choose the category of the blog to be published in the post. get_categories function, from application/helpers/main_helper.php extracts the categories from the selected blog.

History page contains the same published posts which are on the Posts page as well. The difference is that you can see the status (errors)of each post for each social network. If you click on a post, the Delete button will appear, so you can delete it.

RSS Feeds - To add a new Feed RSS, go to Feeds, create New RSS Feed, click and . The RSS feed to be read, you have to activate it and to select the social networks on which it is going to be published.

Networks page, it's the page where the user connect the desired social networks on which are going to be published the posts. For some networks or blogging platforms, could be more steps for connection, after the connections are made, the user chooses on which social networks/blogs the posts will be published on. The user can connect only to the networks which are activated by the admin.

Settings page offers the user to receive notifications or not to receive and to change the email or password.

FAQ page offers answers to questions about users account.

Files
  • application/controllers/Userarea.php - is responsible for controlling the flow of the all User pages and functions.
  • application/models/Notifications.php - displays notifications from database.
  • application/models/Options.php - gets information from database and enables or disables the User's functions.
  • application/helpers/alerts_helper.php - contains all success and unsuccessful messages from User area.
  • application/helpers/main_helper.php - contains the functions get_categories, user_header, get_option, get_site, calculate_time and publish which are used for User area.
  • application/views/user - contains all view files which displays the pages Dashboard, Notifications, Posts, History, Networks, Settings and Faq.
  • application/views/user/layout - contains the layout's files for User pages.
  • assets/user - contains all javascript and css files for the pages Dashboard, Notifications, Posts, History, Networks, Settings and Faq.


Midrub's Cron Jobs #back to top

Midrb's Cron Jobs Commands can be found here: http://blog.midrub.com/midrubs-cron-jobs/

If your server doesn't support url in Cron Jobs commands, you can use the cron.php file.

Source and credit #back to top

Midrub uses the next modules/libraries:

New Features#back to top

Email Marketing

Easy SMTP Configuration

Stripe

Vimeo

Google Plus

Youtube

Dailymotion

Schedule publishing of posts from a RSS Feed

Midrub's Tools

Midrub's Shorter and Click Monitoring

Amazon Feed Generator

Ebay Feed Generator

How to Update Midrub Manually? #back to top

If you have an older version of Midrub you have to download the update from CodeCanyon. Unzip the update. Then, download the folder assets/share from your current version and copy it in the downloaded update. Download the files application/config/database.php and application/config/config.php. Copy these files in the update. Import the tables urls and urls_stats in your database. Delete the current version from server and upload the update.

In the last version the Midrub database has several new tables. Copy the SQL code above of the missing tables and import in your database. The table posts contains a new field: title. The table networks contains a new field: completed.

How to Update Midrub Automatically? #back to top

Changelog #back to top

- Email Marketing

- Translation Support

- New Statistics in User Dashboard

- Vimeo

- Upgraded CodeIgniter

- Upgraded Facebook SDK

- Responsive Fixes

Don't hesitate to Contact Us #back to top

If you have any difficulties to install Midrub, the first time we can install it for you for FREE. Just Contact Us.

You can watch more videos about Midrub's features here https://www.youtube.com/channel/UCQ-LP-o5nlieQfdKfFjX0Sw

If you want to know more about the last Midrub's features, please, read our blog http://blog.midrub.com/