Skip to content

Instantly share code, notes, and snippets.

View lianglee's full-sized avatar
🔋
Charging ....

Arsalan Shah lianglee

🔋
Charging ....
View GitHub Profile
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
$path = '/media/data/ossn_data/';
file_put_contents("{$path}combinepdf.pdf", "test");
1. Obtain our APP access token.
2. https://graph.facebook.com/search?q=<your keyword>&type=page&access_token=$_mytoken
3. Replace $_mytoken with your access token of app
See :
#https://www.facebook.com/groups/fbdevelopers/permalink/1454637214579788/?comment_id=1454642514579258&ref=notif&notif_t=group_comment_reply&notif_id=1498626379556772&_rdc=1&_rdr
@lianglee
lianglee / sql
Created August 2, 2017 19:42
SELECT list is not in GROUP BY
mysql> set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
mysql> set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
@lianglee
lianglee / proposals
Last active November 9, 2017 18:50
Simple way of creating objects
<?php
$proposal = new OssnObject();
//important attributes
$porposal->type = 'user';
$porposal->subtype = 'proposal'; //where this can be your name , but in general its not a table
$porposal->owner_guid = (int) 'guid of user';
$proposal->title = 'sometitle for proposal';
$proposal->description = 'some description for proposal';
@lianglee
lianglee / ossn_com.php
Created May 22, 2018 18:23
A way to add new OssnUser method allowing to show friendship time
<?php
function ossn_friendship_time_init(){
ossn_add_hook('ossn/class/register/method', 'OssnUser:getFriendshipTime', 'friendship_time_private_function');
}
function friendship_time_private_function($hook, $type, $user, array $params = array()){
$freindships = new stdClass;
if(isset($user->guid)) {
$user = $user->guid;
}
$default = array(
<?php
/**
* Open Source Social Network
*
* @package (softlab24.com).ossn
* @author OSSN Core Team <info@softlab24.com>
* @copyright (C) SOFTLAB24 LIMITED
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
* @link https://www.opensource-socialnetwork.org/
*/
@lianglee
lianglee / ads.php
Created March 4, 2019 21:13
Replace components/OssnAds/plugins/default/css/ads.php
.ossn-ad-item {
border-bottom: 1px solid #eee;
margin-bottom: 10px;
word-break: break-word;
}
'group:delete:cover' => 'Delete Cover',
'group:delete:cover:error' => 'An error occurred while deleting the cover image',
'group:delete:cover:success' => 'The cover image was successfully deleted',
'ossn:smilies:admin:settings:compat:off' => 'disabled',
'ossn:smilies:admin:settings:compat:on' => 'enabled',
'ossn:smilies:admin:settings:close_anywhere:title' => 'Close box on clicking anywhere',
'ossn:smilies:admin:settings:close_anywhere:note' => '<i class="fa fa-info-circle"></i> closes the smiley selector box by clicking anywhere on the page<br><br>',
$en = array(
'ossnsmilies' => 'Smilies',
'ossn:smilies:admin:settings:compat:title' => 'Backward compatibility mode',
'ossn:smilies:admin:settings:compat:note' => '<i class="fa fa-info-circle"></i>
Leave this mode <b><u>disabled</u></b> when starting a new social network from scratch with Ossn 4.5 and higher.<br>
A complete set of more than 1000 unicode emojis is available now, thus using old style smilies like :) has become obsolete.<br>
With backward compatibility mode <b><u>enabled</u></b> the following list of old style smilies will be replaced as before:<br>
:(&#x1f641;&nbsp;&nbsp;:)&#x1f642;&nbsp;&nbsp;=D&#x1f600;&nbsp;&nbsp;;)&#x1f609;&nbsp;&nbsp;:p&#x1f61b;&nbsp;&nbsp;8)&#x1f60e;&nbsp;&nbsp;o.O&#x1f62f;&nbsp;&nbsp;:O&#x1f632;&nbsp;&nbsp;:*&#x1f618;&nbsp;&nbsp;a:&#x1f607;&nbsp;&nbsp;:h:&#x2764;&nbsp;&nbsp;3:|&#x1f608;&nbsp;&nbsp;u:&#x1f620;&nbsp;&nbsp;:v&#x1f47b;&nbsp;&nbsp;g:&#x1f61f;&nbsp;&nbsp;c:&#x1f62a;<br>
<br>',
'ossn:smilies:admin:settings:close_anywhere:title' => 'Smiley box
<?php
$json = json_decode('[{"username": "fiona5000"}, {"username": "minarosalaursenan"}, {"username": "arthur54321nu"}, {"username": "benja_manden"}, {"username": "tobi2009_sep1"}, {"username": "vanessalabban"}, {"username": "trilleogtrym"}, {"username": "laursenalberte"}, {"username": "alba_er_smukkere_end_dig"}, {"username": "valdemar_pro"}, {"username": "billieeilish823"}, {"username": "fridas_kreafil_og_andet"}, {"username": "dianachristensen5"}, {"username": "kaspervejby"}, {"username": "emmalarsen16"}, {"username": "livamysling09"}, {"username": "victoriavilladsen2005"}, {"username": "monkeymaster123xd"}, {"username": "cooper.allen"}, {"username": "moustafanahi"}, {"username": "jasmin_gacha_marie"}, {"username": "natalia_ponturo"}, {"username": "ericbaker829"}, {"username": "user13836723981731"}]', true);
if($json){
foreach($json as $item){
echo $item['username'];
}
}