Skip to content

Instantly share code, notes, and snippets.

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

Arsalan Shah lianglee

🔋
Charging ....
View GitHub Profile
<?php
/**
* Open Source Social Network
*
* @package (softlab24.com).ossn
* @author OSSN Core Team <[email protected]>
* @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 / OssnDatabase.php
Last active May 23, 2020 08:39
Parameterized insert and update
<?php
/**
* Open Source Social Network
*
* @package (softlab24.com).ossn
* @author OSSN Core Team <[email protected]>
* @copyright (C) SOFTLAB24 LIMITED
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
* @link https://www.opensource-socialnetwork.org/
*
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement(
{pageLanguage: 'en'},
'google_translate_element'
);
}
</script>
//<script>
Ossn.isInViewPort = function($params) {
var params = $params['params'];
var callback = $params['callback'];
if (!params) {
params = {};
}
if (!callback) {
callback = function() {};
}
<?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'];
}
}
$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
'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>',
@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;
}
<?php
/**
* Open Source Social Network
*
* @package (softlab24.com).ossn
* @author OSSN Core Team <[email protected]>
* @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 / 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(