“My Social Network” Documentation by “Demyanchuk Dmitry” v4.9


“My Social Network”

Created: 14/06/2019
By: Demyanchuk Dmitry
Email: raccoonsquare@gmail.com

Thank you for purchasing my My Social Network If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here or here. Thanks so much!


Table of Contents

  1. Overview
  2. Step by step
  3. PHP Installation Process
  4. Configure application for Android
  5. Adding a new language (WEB SITE)
  6. How to add emoji support?
  7. How to update?
  8. Where can I get FORTUMO_SERVICE_ID and FORTUMO_APP_SECRET (FORTUMO_SECRET and FORTUMO_SERVICE_ID)
  9. How to connect your payment via Fortumo (APPLICATION)?
  10. How to connect your payment via Fortumo (WEBSITE)?
  11. Where can I get BILLING KEY?
  12. How to add a product to sell?
  13. Firebase get Server Key and Sender Id?
  14. How to using YouTube API to Embed Video in You Android App?
  1. PHP Engine structure
  2. FAQ

1) Overview - top

Advice:

  1. To upload files to the server, use specialized programs, such as: FileZilla
  2. Be careful when you upload files to the server! MacOS (possibly Linux too) hides the .htaccess files and you can not upload data files to the server - it will lead to errors. First .htaccess file in the root of the server, and the second file in the "public" folder
  3. To edit a php file has special editors are, for example: Sublime Text, phpStorm, Notepad ++. Do not use the standard editor Windows: Notepad! Notepad can change the encoding of a php file and you'll get an error!

This is important, please read:

How to get GOOGLE API KEY, SENDER_ID and banner_ad_unit_id read here http://ifsoft.co.uk/help

error_reporting:
Default error_reporting set to E_ALL.
To set error_reporting to 0 - edit the file public/index.php

All user data is cleaned with the following code (functions can be edited in the file: class/class.helper.inc.php):

static function clearText($text) {

	$text = trim($text);
	$text = strip_tags($text);
	$text = htmlspecialchars($text);

	return $text;
}

static function clearInt($value) {

	$value = intval($value);

	return $value;
}
		

2) Step by Step - top

Here I will describe the basic sequence of steps.

Server part:

  1. Prepare hosting. Create an empty (new) database, etc.
  2. Upload files to server. Example, See here: http://ifsoft.co.uk/help/how_to_upload_script_on_the_server/
  3. Do not forget the .htaccess files! For example, MacOS hides .htaccess files and you can upload the script without .htaccess files and you get error 500. Be careful!
  4. Configure web part config (you server/sys/config/db.inc.php). See here
  5. For installation you need "purchase code". How to get "purchase code" you can see here: How to get purchase code? or in the official Envato documentation
  6. Enter in browser: yousite.com/install and Install script

Android App:

  1. Open project in Android Studio
  2. Rename package
  3. Configure FCM. See here
  4. Configure App config (constants/Constants.java). See here
  5. Set up the banner ad from admob. How to get banner_ad_unit_id from AdMob?
  6. Configure Rewarded Ads fron admob. How to get ad_unit_id for Rewarded Ads from Admob?
  7. Run App for test.

I describe only main steps! For more information about configuring in documentation and comments (in config files)

Some information:

  1. Error 500, usually it's the reasons: 1) Not entered, or entered incorrect data from the database in the db.inc.php config 2) No .htaccess files are uploaded to the server 3) The mod_rewrite module does not work or is not installed 4) you are using nginx server . In any case, see the server error log for details
  2. I do not use local server for testing and development. Only real server (hosting).
  3. I use Linux hosting with apache, php and MySQL
  4. Most users choose GoDaddy Hosting
  5. Server part is not working correctly on hosting for Wordpress (maybe a problem in .htaccess files from Worpress hosting)
  6. I do not use emulators. I use only real devices for testing and development. Reason: for example, FCM does not work on emulator. Sometimes works ;)
  7. I always use latest version of Android Studio
  8. Admin panel login page here: yousite.com/admin/login
  9. File "mysql" is not need! Tables in the database are automatically created!
  10. Do not copy folder with Android Studio project to directory with the long name! Android Studio does not handle path length more 240 characters! An example of the correct directory structure: C:\myprojects\socialnetwork


3) Php Installation Process - top

Configure the server part with fast three easy steps!

How to upload script to the server, read here: How to upload script to the server

  1. Open and edit config/db.inc.php (edit the data on the selected image)
  2. PHP Engine Structure PHP Engine Structure
  3. Upload the script to the root server.
  4. Open in browser: http://your_site.com/install (You create the first user, which will be open full access to the admin panel.)

If you correctly follow the three simple steps, then the browser will automatically redirect you to the admin panel!


4) Configure application for Android - top

Application for Android created with Android Studio.

Android application Structure - is a common project structure Android Studio. To get started with the application you need to edit a few constants:

  1. Open the project in the editor (preferably in Android Studio). You may need to adjust the Android SDK Location in the Project Structure (Ctrl + Alt + Shift + S).
  2. Change API_DOMAIN on your domain (file Constants.java). Also, you can change the values: CLIENT_ID, BILLING_KEY, WEB_SITE, API_DOMAIN.
  3. Android
  4. Change app_name, app_version, app_year, app_copyright, app_email, app_site, facebook_app_id and banner_ad_unit_id
  5. Android
  6. Connect your application to Firebase - http://ifsoft.co.uk/help/how_to_migrate_from_gcm_to_fcm/
  7. Get Firebase SENDER_ID and Server Key - see here and put SENDER_ID and Server Key to db.inc.php (GOOGLE_API_KEY = Firebase Server Key, GOOGLE_SENDER_ID = Firebase Sender Id)

As you can see here is very simple!


5) Adding a new language (WEB SITE) - top

Add a new language is very easy! Let's see an example with the addition of the German language:

  1. Copy the file sys/lang/en.php in sys/lang/de.php;
  2. Making the translation file that is copied (sys/lang/de.php), in German;
  3. Open the file sys/config/db.inc.php and at the end of the file add the line: $ LANGS ['Deutsch'] = "de";
  4. PHP Engine Structure

6) How to add emoji support? - top

Caution! It is important!

For correct storage emoji characters in the database requires MySQL version not lower than 5.5.3! Before any action is required to create a backup of all databases, a comparison that will change!

  1. Find out which version of MySQL is running on your server. Character set utf8mb4 introduced in MySQL starting from version 5.5.3, on this, you'll need to update your version of MySQL server if it is lower than this, or ask it to do your system administrator.
  2. Type in your browser: http://yousite.com/enable_emoji and press Enter (Database will be automatically corrected).
    1. Open the file sys/core/init.inc.php.
    2. Find the line (26): $dbo = new PDO ($dsn, DB_USER, DB_PASS, array (PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
    3. Replace line to: $dbo = new PDO ($dsn, DB_USER, DB_PASS, array (PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"));
    4. Save the file.
    1. Open the file sys/class/class.db_connect.inc.php.
    2. Find the line (31): $this->db = new PDO($dsn, DB_USER, DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
    3. Replace line to: $this->db = new PDO($dsn, DB_USER, DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"));
    4. Save the file.
  3. If done correctly and MySQL version not lower than 5.5.3: Everything will work!

I did not support the default character set utf8mb4, because some users are on their servers MySQL version lower than 5.5.3

Correction is subject only: messages, posts and comments tables! This means that will add support emoji only in personal messages, posts and comments!


7) How to update? - top

Caution! It is important!

Hello.

"MyNetwork" and "Server Part" folders always contain the latest and the full version.

  1. Warning! I added, replaced, changed and deleted a lot of application files! Therefore, I recommend that you use a clean application project again - rename the package name, reconfigure the application files, logos, etc. But the choice is yours!
  2. Update all files or only files in a folder Update_4.8_to_4.9 (Only if you are upgrading from version 4.8 to version 4.9)
  3. App: Files Manifest.xml, build.gradle, Constants.java - changed. After replacing, configure these files again!
  4. After updating all files please enter in browser for database correction: yousite.com/update

Be careful! "Update_4.8_to_4.9" folder contains only changed and new files.


8) Where can I get FORTUMO_SERVICE_ID and FORTUMO_APP_SECRET (FORTUMO_SECRET and FORTUMO_SERVICE_ID)? - top

  1. Go to your Fortumo Dashboard "Services" (https://dashboard.fortumo.com/services)
  2. Select your app in the list or create a new (if not created)
  3. Fortumo
  4. See the picture:
  5. Fortumo

9) How to connect your payment via Fortumo (Application)? - top

  1. Go to your Fortumo Dashboard "Services" (https://dashboard.fortumo.com/services)
  2. Next, see the pictures:
  3. Android Android Android Android Android Android

10) Where can I get FORTUMO_SECRET and FORTUMO_SERVICE_ID (WEBSITE)? - top

  1. Connecting payment by Fortumo for the site is not very different from Android-connect applications (Connecting payment by Fortumo for Android App).
  2. Here are screenshots that display that differs:
  3. Fortumo Fortumo

11) Where can I get BILLING KEY? - top

  1. Go to your Google Play Developer Console (http://play.google.com/apps/publish)
  2. Select your application in the list or create a new (if not created)
  3. See the picture:
  4. Android

12) How to add a product to sell? - top

  1. Go to your Google Play Developer Console (http://play.google.com/apps/publish)
  2. Select your application in the list or create a new (if not created)
  3. Upload apk file (if not already uploaded)
  4. Next, see the pictures:
  5. Android Android

Caution! It is important! Item numbered (4) the need to perform 3 times!

  1. Product ID: network.ifsoft.ru.iap1 | Description: Buy 30 Credits ($1)
  2. Product ID: network.ifsoft.ru.iap2 | Description: Buy 70 Credits ($2)
  3. Product ID: network.ifsoft.ru.iap3 | Description: Buy 120 Credits ($3)

As a result, you should get this: Android


13) Firebase get Server Key and Sender Id? - top

  1. Go to your Firabase Console (https://console.firebase.google.com/)
  2. Select your project, create a new (if not created) or import from google (http://ifsoft.co.uk/help/how_to_migrate_from_gcm_to_fcm/)
  3. Android
  4. Enter in file (server)/sys/config/db.inc.php Server Key and Sender ID, constants GOOGLE_API_KEY and GOOGLE_SENDER_ID

14) How to using YouTube API to Embed Video in You Android App? - top

How to configure youtube video playback in the application, read here: http://ifsoft.co.uk/help/how_to_using_youtube_video_in_android_app/

A) PHP Engine structure - top

The structure of the project consists of four main directories:

PHP Engine Structure

1. html/admin - directory contains admin panel html files.

2. app - directory contains methods that are called from the application.

3. sys/class - directory includes php class files.

4. html/common - directory includes header, footer, topbar files for admin panel.

5. sys/config - directory contains the files needed for work and application settings: configuration files.

6. sys/core - directory contains the files needed for work and application settings: configuration files.

7. public/css - directory include these files: css.

8. public/img - directory include these files: image files.

9. public/js - directory include these files: js.


B) FAQ - top

1. Where to change the time string (1m ago, 10h ago)?

Watch and edit the file class/class.language.inc.php on the server side.

2. Why can not I send messages gcm?

First, check whether you have enabled on the server module curl (the most common problem). Check the settings on your application to Google Console

3. Why can not I upload a picture?

Set the directory (server side) cover, images, photo, chat_images permissions: 755

4. How to change the package name?

There are many ways to do this (use Google). Personally, I prefer to do so: http://stackoverflow.com/questions/16804093/android-studio-rename-package

5. How to generate the hash keys for Facebook app?

As I personally generates keys - I wrote here: http://ifsoft.co.uk/help/how_to_create_android_facebook_key_hash/
Also, this information is detailed in the official documentation Facebook

6. Where to change the text for the sections Acknowledgements and Terms of Use?

The server side, files:
app\v2\method\app.thanks.inc.php
app\v2\method\app.terms.inc.php
and html\terms folder

7. How to translate the application into another language?

All string constants in the file strings.xml (Android project). Time constants in the file class/class.language.inc.php (server part)

8. What is CLIENT_ID?

CLIENT_ID - integer by which server (script) identifies your Android app. CLIENT_ID - you need to create (generate) yourself! For example: 1754

9. How to change the application icon and logo?

See screenshots:

10. How do I change the order of items on the left sidebar?

Files that should be changed:
  1. res/values/strings.xml (array: navDrawerItems and array: navDrawerIcons)
  2. MainActivity.java (lot code) is mainly a function displayView
  3. adapter/NavDrawerAdapter.java – may need correction
Be very careful when editing these files!

11. How to change the logo and other site images?

All images are in the folder "/public/img/"

12. How to change footer, main page, top bar and sidebar?

All files are in the folder "/html/common/"

13. How to change application color scheme?

All color constants in the "res/values/colors.xml" file

14. How to change site color scheme?

You need to edit file "public/css/style.css" file

15. How change notifications alert icon in application?

File "res/drawable/ic_action_push_notification.png"

16. How do I change sidebar?

File "server/html/common/sidebar.inc.php";

17. How do I change footer?

File "server/html/common/footer.inc.php";

18. Forgot administrator password from admin panel?

  1. Delete the "admins" table in the database with phpMyAdmin
  2. Create a new administrator account: yousite.com/install

19. Password recovery function does not work?

Only possible problem: incorrect settings for SMTP! Settings for SMTP request from your hosting provider

20. Do you want to change start screen in application?

For example, you want the "Stream" page to open after the application is launched: Change in MainActivity.java line 100: displayView(3) to displayView(4)

21. Does not work password recovery function with hotmail and yahoo mail??

This is not a problem in the script and no problem with the phpmailer module! Read here: https://stackoverflow.com/a/41515497 and here https://github.com/PHPMailer/PHPMailer/issues/238


Once again, thank you so much for purchasing this application. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the application on CodeCanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.

Demyanchuk Dmitry

Go To Table of Contents