Sharetronix

User manual

From Sharetronix Developer Documentation
Jump to: navigation, search

Contents

Introduction

Sharetronix SocialPulseā„¢ OPEN SOURCE is an open source multimedia microblogging platform targeted to private and business needs. It helps people in a community, company, or group to exchange short messages and multimedia content over the Web. Find more information on http://developer.sharetronix.com]. This document shows you how to register, install the latest sharetronix version and set your sharetronix key. Sharetronix is an extremely rich network with many functionalities expanded by variety of apps. The system supports post attachment of links, videos, pictures and files. Users are organized in groups. Posts can contain tags for easy organization and monitoring of various topics. Sign up at our community to create an account at www.community.sharetronix.com .

Registration and download

Having an account at http://developer.sharetronix.com will allow you to download the latest version of our software and install it locally for non-commercial use. Additionally you'll be able to download variety of apps from our Appstore and the most important is that you'll get support from our open source community if you need.

  1. First click on Sign up now button
  2. Enter your email address and confirm it
  3. At registration page fill out your personal info - real name, user name, password and image code and submit it
  4. Now you'll be able to download the latest sharetronix version from Download page

License

Please check out the license.txt file. By installing Sharetronix, you agree to all the conditions of the license and also to the Sharetronix Terms of Use: http://developer.sharetronix.com/pages/license

System Requirements

  • Apache Web Server
  • MySQL version 5.0 or higher
  • PHP version 5.2 or higher

Installation

See our video here, Sharetronix Installation Guide.

  1. Verify that your webserver is compatible with software System Requirements
  2. Download the Source Code here ( or click the button above).
  3. Extract the files from the ZIP archive.
  4. Upload the contents of the folder titled "upload/" to the preferred location on your webserver (wherever you want to install our script) with your favorite FTP client.
  5. Create an empty MySQL database and add user privileges (ALL PRIVILEGES) to the database.
  6. Open the "install/" location with your browser and follow the steps:
    • Agree to Sharetronix License.
    • Fill in the information about the database - mysql host, username, password, database name.
    • System Compatibility Check: if there are any dependencies, correct them to continue.
    • Choose a Cache Mechanism. If you have administrative privileges on your web server, we strongly recommend that you install Memcached or APC. If you do not have administrative privileges, then choose to use filesystem cache or MySQL memory table.
    • Files & Folders Permissions. Use your FTP client to set permissions (chmod) 0777 for the listed files and folders.
    • Fill in the title and the URL of your installation.
    • Create administrative account: by default, this account follows everyone, and is followed, by everyone. Admin also has permissions to delete any posts.
    • Installation is complete; please delete the "install/" folder and its contents.
  7. If you have troubles installing, please contact us. You can also check out our Installation Guide video or the Installation Guide video provided by RandyMac.

One click install: Arvixe.

To install Sharetronix Opensource on your webserver, upload the contents of the "upload/" folder to the preferred location on your webserver (wherever you want to install Sharetronix) with your favorite FTP client. Open with your browser the "install" location in this folder and follow the steps in the installation wizard.

Upgrade to Sharetronix 3.0.0 from Sharetronix 2.2.1

In order to upgrade Sharetronix SocialPulseā„¢ Opensource from a previous version, just follow the steps below. But first - don't forget to backup your old installation (database and files). It's important!

  1. Go to your root folder (where your site is located)
  2. Rename 'i' folder to 'storage'
  3. Go into 'storage' folder and remove the following folders and its contents: 'custom', 'icons', 'js', 'swf'
  4. Delete all files and folders in ./themes folder.
  5. Delete following folders and its contents into the 'system' folder: 'controllers', 'classes', 'cronjobs', 'helpers', 'languages'
  6. Copy all files and folders from 'upload' folder of Stx 3.0 package and paste it to your root folder, allow replace if needed.
  7. Check and if needs change the permissions of:
    • '/system/languages' folder - it has to be 777
    • '/system/cache_html' folder - it has to be 777
    • '/storage' folder - it has to be 777
    • '/apps' folder - it has to be 777
  8. Go to your database and execute the following queries:
CREATE TABLE  `plugins` (
	`id` INT( 6 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
	`name` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
	`is_installed` TINYINT( 1 ) UNSIGNED NOT NULL ,
	`date_installed` INT( 10 ) UNSIGNED NOT NULL ,
	`installed_by_user_id` INT( 10 ) UNSIGNED NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE TABLE  `plugins_cache` (
	`id` INT( 6 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
	`plugin_name` CHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
	`event_name` CHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
	INDEX USING BTREE (  `plugin_name` ,  `event_name` )
) ENGINE = MEMORY CHARACTER SET utf8 COLLATE utf8_unicode_ci;

ALTER TABLE  `posts_comments_watch` CHANGE  `newcomments`  `newcomments` VARCHAR( 255 ) NOT NULL;
CREATE TABLE IF NOT EXISTS `plugins_installed` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`name` varchar(50) NOT NULL,
	`marketplace_id` int(11) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `languages` (
	 `id` int(10) NOT NULL AUTO_INCREMENT,
	 `langkey` varchar(50) NOT NULL DEFAULT '0',
	 `installed` int(10) DEFAULT NULL,
	 `version` int(11) DEFAULT NULL,
	 PRIMARY KEY (`id`),
	 UNIQUE KEY `langkey` (`langkey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `languages` (`langkey`, `installed`, `version`) VALUES ( 'en', 1, 0);
				
CREATE TABLE IF NOT EXISTS `plugins_tables` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`table` varchar(255) NOT NULL,
	`owner` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	UNIQUE KEY `table` (`table`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;					

Save this script as file_name.php, fill your server data in it, upload and execute it to your server as php file.

<?php			
$server = 'your server';
$dbUser = 'username_for_mysql_db';
$dbPass = 'password_for_mysql_db';
$dbName = 'your_db_name';

$conn = mysql_connect($server, $dbUser, $dbPass);
if (!$conn) {
    die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db($dbName, $conn);
if (!$db_selected) {
    die ('Can\'t connect to ' . $dbName . ' ' . mysql_error());
}

		
$tmp	= mysql_query('SHOW TABLES FROM '.$dbName, $conn);
while($tbl = mysql_fetch_row($tmp)) {
	$tbl	= $tbl[0];
	$res = mysql_query("INSERT INTO `plugins_tables` (`table`, `owner`) VALUES ('".$tbl."', 'system')", $conn);
	
}
mysql_close($conn);	
?>

Sharetronix 3.1.1.3 updated files list

  1. /upload/static/templates/system/blocks/editor-textarea.php
  2. /upload/static/templates/system/mobile/blocks/activity-comments-container.php
  3. /upload/system/helpers/routines/loadDefaultFooter.php
  4. /upload/system/helpers/routines/loadMobileMenu.php
  5. /upload/system/helpers/func_html.php
  6. /upload/system/controllers/user.php
  7. /upload/system/classes/class_htmlBlock.php
  8. /upload/system/classes/class_pageDesigner.php
  9. /upload/system/classes/class_layout.php

Plugins installation

The Sharetronix plugin architecture allows you to install apps directly from the administration page of your installation. You should login to the system with your administartion account and follow the steps bellow.

  1. Go to administration page
  2. Click "Plugins" on the left menu panel
  3. Get your sharetronix serial key from http://developer.sharetronix.com
    • Login with your community account
    • Click "Profile" on the right panel
    • You should be able to see and copy your sharetronix personal serial key. It is in XXXXX-XXXXX-XXXXX-XXXXX format
  4. Paste the sharetronix personal key to the first "Sharetronix Key:" field
  5. Submit your Community/Appstore username and password

Now you should be able to install apps directly from your adminstration page

Using Google reCaptcha

To activate the google reCaptcha on your sharetronix community follow the steps below:

  1. Go to https://www.google.com/recaptcha/admin/create#
  2. Create your private and public keys.#
  3. Open the ./conf_main.php file#
  4. Enter the value for the private key at $C->GOOGLE_CAPTCHA_PRIVATE_KEY#
  5. Enter the value for the public key at $C->GOOGLE_CAPTCHA_PUBLIC_KEY#

Facebook connect

 To activate Facebook Connect integration for your Sharetronix site, first you have to register a Facebook application and get its API key:
  1. Complete the Sharetronix installation/upgrade script#
  2. Go to FB and join the Developers group: http://developers.facebook.com/#
  3. Go to https://developers.facebook.com/apps and click on "Create new app" button#
  4. Fill in only the "App Name" field with the name of your application and click on the "Continue" button.#
  5. Enter the captcha code if captcha popup appear and click on the "Continue" button.#
  6. Fill the "App Domain", if your sharetronix community is hosted at http://www.site.com or http://app.site.com or http://site.com/app, your domain is site.com #
  7. Click on the "Website with Facebook Login" section and add you community url, eg. http://www.site.com, http://app.site.com, http://site.com/app#
  8. Click on the "Save changes" button#
  9. Your App key/ID and App Secret are in your application description, copy both and paste in your ./system/conf_main.php file in#
 $C->FACEBOOK_API_KEY		= 'Your Key';
 $C->FACEBOOK_API_ID		= 'Your app id'; 
 $C->FACEBOOK_API_SECRET	= 'Your app secret';

Twitter connect

To activate Twitter OAuth Login for your Sharetronix site, first you have to register a Twitter application and get its Consumer KEY and SECRET:

  1. Complete the Sharetronix installation/upgrade script#
  2. Go to the Twitter New Application form: https://dev.twitter.com/apps and click on "Create New Application" button#
  3. Fill App Name, Description and Website(eg. http://mysharetronixcommunity.com).#
  4. Agree with "Developer Rules Of The Road", enter the captcha code and click on the "Create your Twitter application" button.#
  5. Click on the "Settings" tab and in the "Application Type" section for access type choose "Read and Write" and click on "Update this Twitter's application" button#
  6. Go to the "Details" tab and copy your application's "Consumer key" and "Consumer secret" and paste them in your ./system/conf_main.php file in the #
 $C->TWITTER_CONSUMER_KEY	= ;
 $C->TWITTER_CONSUMER_SECRET	= ;
  1. You MUST also put a Callback URL in the SETTINGS tab in your twitter application. Set it to your community_URL/signup

Sharetronix technical FAQ

Suddenly my main site went blank

Many people have the problem with blank page with their installation. The main reason for this is because they are using cache mechanism #mysqlheap. You can check this post for more information.

I can't enable mod_rewrite.

Mod_rewrite is required, Sharetronix cannot run without it. But most of the servers have mod_rewrite enabled by default. Maybe you have it too, there can be a bug in the Sharetronix installation wizard. Try the following: Please open the file ./install/include/step_3.php and remove line 19 ( 'apache_mod_rewrite' => FALSE ) - this will disable the mod_rewrite check and everything should be fine. If it doesn't work, you should contact your hosting provider and ask them to activate mod_rewrite.

Getting an error Cannot connect - please check host, username and password.

If you get the following error: Notice: Undefined variable: conn in I:\blog\install\include\step_2.php on line 76 Installation - Step 2 Database Settings Fill in the information about the MySQL database. For new Sharetronix installations you must create an empty MySQL database. Error Cannot connect - please check host, username and password. This means that your MySQL username, MySQL password or MySQL host is not valid. So, to continue with the installation you will have to provide valid MySQL database details, because the installation script have to connect to you mysql database (do not forget to create a new database before starting the installation process) and grant privileges to appropriate username.

Why when users signup the emails are sent as junk to their inbox? what is wrong?

There could be many reasons for this. First, try the following: In the Administration -> General Settings - see the email address in the "Contact email" field. You should set this email address to something@your-site-domain.com. If it is something@another-domain.com, this could be the problem. If this doesn't work, check if the server is blacklisted. You can do this here: http://www.mxtoolbox.com/ You can also try to set-up for your server's ip address a reverse-dns record pointing to the domain.

How are you encrypting passwords?

The password is the string entered by user in $_POST field ($password = $_POST['password']). After that this string is md5 hashed using the standard php function md5() (http://php.net/manual/en/function.md5.php). The return value of the function is a hash as a 32-character hexadecimal number.

Why it is not sending emails when user invites more than 100 friends?

Currently Sharetronix uses the built-in PHP function mail() which uses the default server Mail Transport Agent (sendmail, postfix). You can change that from ./system/helpers/func_main.php - functions do_send_mail and do_send_mail_html.

MySQL-Host is "localhost:/tmp/mysql5.sock". Is it possible to use this during the installation-process?

It is possible, there shouldn't be any problem. If something goes wrong, please contact us.

What kind of HTTP server you use?

Sharetronix requires Apache because of the Apache mod_rewrite module.

How can we make it so when people log in the default view is set to Everyone instead of Activity feed?


Open the file ./system/controllers/dashboard.php and find the following code (I guess on line 56): $tab = 'all'; Change it to: $tab = 'everybody';

During the installation, I get error code "V4dCBldm"

This error is related to the database creation. Check if your mysql user has privileges to use CREATE, DROP and ALTER commands.

Fatal error: Call to undefined method DateTimeZone::listIdentifiers() in /home/lelacag/public_html/XXXX on line 28

This error is related to some built-in PHP functions for date and time manipulations, but it seems that those functions require PHP version 5.2 or higher, and your version is older. You should upgrade your PHP version for this to work. If this is impossible, the other option is to remove those functions from ./system/controllers/admin_general.php and ./system/controllers/settings_system.php.

Fatal error: Call to undefined method DateTimeZone::listIdentifiers()

This error is related to some built-in PHP functions for date and time manipulations, but it seems that those functions require PHP version 5.2 or higher, and your version is older. You should upgrade your PHP version for this to work. If this is impossible, the other option is to remove those functions from ./system/controllers/admin_general.php and ./system/controllers/settings_system.php.

Sharetronix optimization tips

Here are some tips for improving Sharetronix performance and speed.

Upgrade your Sharetronix version regularly.

Our team is working hard every day to improve Sharetronix and we strongly recommend to upgrade your installation regularly. Since version 1.4.1 you are able to upgrade it without overwriting everything and running the install script - there is a list of changed files which you can overwrite manually. Get the latest Sharetronix version from here:http://sharetronix.com/opensource/download

Set fast caching mechanism

Sharetronix stores a lot of data into a cache for faster access. This cache can be stored on the filesystem or in the database, but it's highly recommended to store it into the server's operating memory (RAM). This can be done in two ways, but you will need a root access to the server. The first way is the Memcached caching system which can be implemented in PHP with the Memcacheor Memcached extensions. The second way is the APC (Alternative PHP cache) extension. If you install one of them, you should set the variable $C->CACHE_MECHANISM in the Sharetronix configuration file - ./system/conf_main.php.

Install eAccelerator on your server

eAccelerator is a free open-source PHP accelerator & optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times. You can find more information here: http://eaccelerator.net

Set a cronjob for Sharetronix on your server

Sharetronix needs some scripts to be ran in background periodically. This can be done very well with Cronjobs, but the problem is that most of the hosting providers don't support cronjobs. If your server supports cronjobs, you can fix this by setting the following cronjob to run every minute with the linux crontab command

* * * * *  /path/to/your/cli/php /path/to/your/sharetronix/system/cronjobs/worker.php

If your hosting provider doesn't support cronjobs you may look for an external Cron service. Here we would like to introduce EasyCron webcron service.

In order to set this service follow the procedure below:

  1. Copy the /sytem/cronjobs folder to your sharetronix root folder
  2. Rename this folder to a complex known only by you folder name
  3. Create an .htaccess file forbidding the access to this folder. You may create an empty file and paste the following line:
    Options -Indexes
  4. Create an account in EasyCron
  5. Create a new cronjob. Set the cronjob
    URL to call: http://your_community.com/your_new_cronfolder/worker.php
    When to execute (Choose an interval): minute
  6. Click on Create Cron Job button and you are ready

Use ImageMagick for image processing

By default Sharetronix uses PHP's GD extension for processing images, which is not good enough. If there is ImageMagickinstalled on your server (or you have root access and can install it), it's recommended to use its command line tools for image processing. In the Sharetronix configuration file (./system/conf_main.php) you need to set the variable $C->IMAGE_MANIPULATION to "imagemagick_cli" and the variable $C->IM_CONVERT to the path to the Convert program (usully /usr/bin/convert).

Set the RPC servers which Sharetronix pings on each new post

By default on each new post Sharetronix pings the rpc.pingomatic.com RPC server so the post can be indexed faster by Google and other search engines. You can specify more than one RPC servers, but it can cause delays. Important: if your Sharetronix installation is behind-the-firewall (not public) or you just don't want to ping these servers, disable this functionality in ./system/conf_main.php - set $C->RPC_PINGS_ON to FALSE.

Personal tools
Namespaces

Variants
Actions
STX User guide
STX Developer guide
Sharetronix Sites