Given to those most active on the site.
-
36 Posts
-
2 Photos
-
2 Videos
-
Male
-
10/06/1962
-
Followed by 6 people
My Zodiac
Tiger
Brave, confident, competitive
-
change your site look Digital NewFreeIn stock0 ReviewsThis code can be further developed, including integrating your own database and more. You can also place it anywhere you like, such as in _header.tpl.
This code can be further developed, including integrating your own database and more. You can also place it anywhere you like, such as in _header.tpl.1 Comments 0 Shares 4K Views 0 ReviewsPlease log in to like, share and comment! -
where's Jane Marcia ? she is mia on us
where's [JaneMarcia] ? she is mia on us7 Comments 0 Shares 3K Views 0 Reviews
3
-
my little community https://www.unitymix.commy little community https://www.unitymix.com
WWW.UNITYMIX.COMUnitymix | Where Creators and Communities ThriveUnitymix is the next-gen social platform for creators and communities. Grow your brand, monetize content, and connect with your audience.1 Comments 0 Shares 3K Views 0 Reviews
2
-
-
-
To display amount of users already joined your networkTo display amount of users already joined your network
To display amount of users already joined your network
Add in your index.php: // count all users$get_total_users = $db->query("SELECT COUNT(*) as count FROM users") or _error("SQL_ERROR");$total_users = (int) $get_total_users->fetch_assoc()['count']; // assign to smarty$smarty->assign('total_users', $total_users); Step 2 – Display in index.landing.tpl <div class="landing-users-count text-center mt-4"> <h3>{$total_users|number_format}</h3> <p>Members have already joined</p> </div>
View Discussion0 Comments 0 Shares 3K Views 0 Reviews2
-
[JaneMarcia]File Type: zip0 Comments 0 Shares 2K Views 0 Reviews1
-
ready-to-follow Sngine optimization checklistready-to-follow Sngine optimization checklist
ready-to-follow Sngine optimization checklist
Improving Sngine performance involves both server-side and client-side optimizations since Sngine is PHP/MySQL-based and can be heavy if not optimized. Here’s a step-by-step guide: 1. Optimize Your Hosting Environment Choose a fast server: Use VPS or dedicated hosting instead of shared hosting. PHP version: Use the latest stable PHP (e.g., PHP 8.2+) for performance improvements. Database: MySQL/MariaDB should have optimized settings (innodb_buffer_pool_size, query_cache_size). Enable OPcache: This caches PHP bytecode for faster execution. SSL & HTTP/2: Faster HTTPS connections improve load times. 2. Optimize Database Index frequently queried fields: e.g., posts, users, likes. Clean old data: Delete old logs, sessions, and temporary files. Use proper data types: Avoid TEXT or VARCHAR(255) when smaller fields suffice. Optimize queries: Use EXPLAIN to check slow queries and add indexes as needed. 3. Enable Caching Page caching: Use tools like LiteSpeed Cache or NGINX FastCGI cache. Database query caching: Use Redis or Memcached to cache frequent queries. Object caching: Cache objects like user info, notifications, and posts. 4. Optimize Assets Minify CSS & JS: Use tools to reduce size. Combine files: Reduce HTTP requests. Use Gzip/Brotli: Enable compression on the server. Lazy load images: Especially in feeds or media-heavy pages. Use WebP for images to reduce size. 5. Optimize Sngine Code Limit feed queries: Use LIMIT and OFFSET efficiently. Use AJAX for loading posts: Instead of loading all posts at once. Reduce unnecessary queries: Avoid repeated queries in loops. Check modules/plugins: Disable any unused plugins to reduce overhead. 6. Use a Content Delivery Network (CDN) Serve static files (images, JS, CSS) through a CDN. Offload traffic from your server and reduce latency for global users. 7. Monitor and Test Use Google PageSpeed Insights, GTmetrix, or Lighthouse. Identify slow queries using MySQL slow query log. Monitor server performance with tools like New Relic or PHP-FPM status. 8. Optional Advanced Tweaks Varnish Cache: For full-page caching. Memcached/Redis: For session caching. Database replication: If you have very high traffic, consider read-replicas. Queue system: Offload heavy tasks (like notifications or emails) to a queue system (Redis + Laravel Queue or RabbitMQ).
View Discussion0 Comments 0 Shares 4K Views 0 Reviews1
-
Sngine Do Not Sell/Share My Data Addon for you.Sngine Do Not Sell/Share My Data Addon for you.
Sngine Do Not Sell/Share My Data Addon for you.
Installation Upload the contents of the zip into your Sngine root directory. includes/ajax/do_not_sell.php content/themes/yourtheme/templates/_do_not_sell.tpl install.sql Run install.sql on your MySQL database to add the new column: ALTER TABLE users ADD COLUMN do_not_sell TINYINT(1) NOT NULL DEFAULT 0; In your theme footer template (_footer.tpl), include the modal: {include file="_do_not_sell.tpl"} Clear cache and refresh your site. 1. Database Update Extend install.sql: ALTER TABLE users ADD COLUMN allow_ads TINYINT(1) NOT NULL DEFAULT 1; (Defaults to 1 so personalized ads are allowed until user opts out.) 2. Update Modal Template (_do_not_sell.tpl) Replace your modal content with this: <!-- Do Not Sell or Share My Personal Data --> <a href="#" id="dns-trigger" class="small text-muted">Privacy & Data Preferences</a> <div id="dns-overlay" class="dns-overlay" role="dialog" aria-modal="true" aria-labelledby="dns-title"> <div class="dns-modal" role="document"> <button class="dns-close" id="dns-close">×</button> <h2 id="dns-title">Privacy & Data Preferences</h2> <!-- Do Not Sell --> <h5>Do Not Sell or Share My Personal Data</h5> <p> By choosing this option, you are requesting that {$system['system_title']} does not sell or share your personal information. </p> <div class="dns-actions mb-3"> <button class="btn btn-primary w-100" id="dns-confirm">Do Not Sell or Share My Data</button> </div> <hr> <!-- Personalized Ads --> <h5>Personalized Advertising</h5> <p> To enable personalized advertising (like interest-based ads), we may share your data with our marketing and advertising partners using cookies and other technologies. Those partners may have their own information they've collected about you. </p> <p> Turning off this setting won't stop you from seeing ads, but it may make the ads you see less relevant or more repetitive. </p> <p class="text-muted small"> Personalized advertising may be considered a "sale" or "sharing" of information under California and other state privacy laws. Learn more in our <a href="{$system['system_url']}/privacy">Privacy Policy</a>. </p> <div class="form-check mb-3"> <input class="form-check-input" type="checkbox" id="allow-ads" {if $user->_data['allow_ads']}checked{/if}> <label class="form-check-label" for="allow-ads"> Allow personalized advertising </label> </div> <div class="dns-actions"> <button class="btn btn-light" id="dns-cancel">Cancel</button> <button class="btn btn-primary" id="ads-save">Save Preferences</button> </div> </div> </div> 3. Update JavaScript (inside _do_not_sell.tpl) Extend the script: <script> $(function() { var overlay = $("#dns-overlay"); $("#dns-trigger").on("click", function(e) { e.preventDefault(); overlay.addClass("active"); }); $("#dns-close, #dns-cancel").on("click", function() { overlay.removeClass("active"); }); // Do Not Sell / Share $("#dns-confirm").on("click", function() { $.post(site_ajax + "/do_not_sell.php", {action: "optout"}, function(response) { if(response.success) { alert("Your preference has been saved."); } else { alert("Something went wrong. Please try again."); } overlay.removeClass("active"); }, "json"); }); // Personalized Ads $("#ads-save").on("click", function() { var allow_ads = $("#allow-ads").is(":checked") ? 1 : 0; $.post(site_ajax + "/do_not_sell.php", {action: "ads", allow_ads: allow_ads}, function(response) { if(response.success) { alert("Your ad preference has been updated."); } else { alert("Something went wrong. Please try again."); } overlay.removeClass("active"); }, "json"); }); }); </script> 4. Update AJAX Handler (do_not_sell.php) <?php require('../../../bootstrap.php'); // check ajax request is_ajax(); // user must be logged in if(!$user->_logged_in) { return_json(array('success' => false, 'message' => "Login required")); } try { switch ($_POST['action']) { case "optout": $db->query(sprintf("UPDATE users SET do_not_sell = 1 WHERE user_id = %s", secure($user->_data['user_id'], 'int'))); return_json(array('success' => true)); break; case "ads": $allow_ads = ($_POST['allow_ads'] == 1) ? 1 : 0; $db->query(sprintf("UPDATE users SET allow_ads = %s WHERE user_id = %s", secure($allow_ads, 'int'), secure($user->_data['user_id'], 'int'))); return_json(array('success' => true)); break; default: return_json(array('success' => false)); } } catch (Exception $e) { return_json(array('success' => false, 'message' => $e->getMessage())); }
View Discussion0 Comments 0 Shares 4K Views 0 Reviews1
-
Here's a complete, ready-to-install Sngine Passkey module for your site. It includes database, controller, template, and JS, fully set up for production-ready WebAuthn.Here's a complete, ready-to-install Sngine Passkey module for your site. It includes database, controller, template, and JS, fully set up for production-ready WebAuthn.
Here's a complete, ready-to-install Sngine Passkey module for your site. It includes database, controller, template, and JS, fully set up for production-ready WebAuthn.
. Database SQL Save as passkey_module.sql and import into your database: -- Table for storing passkeys CREATE TABLE `user_passkeys` ( `id` INT AUTO_INCREMENT PRIMARY KEY, `user_id` INT NOT NULL, `credential_id` VARCHAR(255) NOT NULL, `public_key` TEXT NOT NULL, `key_name` VARCHAR(255) DEFAULT 'Device', `sign_count` INT DEFAULT 0, `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`) ON DELETE CASCADE ); <?phpif (!defined('_Sngine')) die('Direct access not allowed'); use Webauthn\AuthenticatorAssertionResponse;use Webauthn\AuthenticatorAttestationResponse;use Webauthn\PublicKeyCredentialLoader; $action = $_POST['action'] ?? ''; switch ($action) { // REGISTER PASSKEY case 'register': $user_id = $user->_data['user_id']; $credentialData = $_POST['credential'] ?? ''; $keyName = $_POST['keyName'] ?? 'Device'; if(!$credentialData) return_json(['status'=>'error','message'=>'No credential sent']); $loader = new PublicKeyCredentialLoader(); $publicKeyCredential = $loader->loadArray(json_decode($credentialData, true)); $attestationResponse = $publicKeyCredential->getResponse(); if(!$attestationResponse instanceof AuthenticatorAttestationResponse) return_json(['status'=>'error','message'=>'Invalid response']); $credentialId = base64_encode($publicKeyCredential->getRawId()); $publicKey = base64_encode($attestationResponse->getAttestationObject()); $db->query("INSERT INTO user_passkeys (user_id, credential_id, public_key, key_name) VALUES (?, ?, ?, ?)", [$user_id, $credentialId, $publicKey, $keyName]); return_json(['status'=>'success','message'=>'Passkey registered']); break; // LOGIN CHALLENGE case 'login': $username = $_POST['username'] ?? ''; if(!$username) return_json(['status'=>'error','message'=>'Username required']); $user_row = $db->query("SELECT * FROM users WHERE username = ?", [$username])->fetch(); if(!$user_row) return_json(['status'=>'error','message'=>'User not found']); $challenge = base64_encode(random_bytes(32)); $_SESSION['passkey_challenge'] = $challenge; $passkeys = $db->query("SELECT id, key_name, credential_id FROM user_passkeys WHERE user_id = ?", [$user_row['user_id']])->fetchAll(); return_json(['status'=>'success','challenge'=>$challenge,'passkeys'=>$passkeys,'user_id'=>$user_row['user_id']]); break; // VERIFY LOGIN case 'verify': $user_id = $_POST['user_id'] ?? 0; $credentialData = $_POST['credential'] ?? ''; if(!$credentialData) return_json(['status'=>'error','message'=>'No credential']); $loader = new PublicKeyCredentialLoader(); $publicKeyCredential = $loader->loadArray(json_decode($credentialData, true)); $assertionResponse = $publicKeyCredential->getResponse(); if(!$assertionResponse instanceof AuthenticatorAssertionResponse) return_json(['status'=>'error','message'=>'Invalid response']); $dbPasskey = $db->query("SELECT * FROM user_passkeys WHERE user_id = ? AND credential_id = ?", [$user_id, base64_encode($publicKeyCredential->getRawId())])->fetch(); if(!$dbPasskey) return_json(['status'=>'error','message'=>'Passkey not found']); $publicKey = base64_decode($dbPasskey['public_key']); $signCount = $dbPasskey['sign_count']; try { $assertionResponse->verify($_SESSION['passkey_challenge'], $publicKey, $signCount); $db->query("UPDATE user_passkeys SET sign_count = ? WHERE id = ?", [$assertionResponse->getSignCount(), $dbPasskey['id']]); $_SESSION['user_id'] = $user_id; return_json(['status'=>'success','message'=>'Logged in successfully']); } catch(Exception $e) { return_json(['status'=>'error','message'=>'Verification failed: '.$e->getMessage()]); } break; default: return_json(['status'=>'error','message'=>'Invalid action']); break;} 3. Template File: content/themes/unity+/templates/passkey.tpl {include file='_head.tpl'} {include file='_header.tpl'} <div class="container mt-5"> <h2>Passkey Login & Registration</h2> <div class="mb-3"> <input type="text" id="username" placeholder="Username" class="form-control"> </div> <button class="btn btn-primary mb-2" onclick="registerPasskey()">Register Passkey</button> <button class="btn btn-success" onclick="loginWithPasskey()">Login with Passkey</button> <div id="passkey-msg" class="mt-3"></div> </div> <script> async function registerPasskey() { const publicKey = { challenge: Uint8Array.from(window.crypto.getRandomValues(new Uint8Array(32))), rp: { name: "UnityMix" }, user: { id: Uint8Array.from([1,2,3,4]), name: "user@example.com", displayName: "User" }, pubKeyCredParams: [{ type: "public-key", alg: -7 }], }; try { const credential = await navigator.credentials.create({ publicKey }); const credentialJSON = JSON.stringify(credential); const res = await fetch('/controllers/pages/passkey.php', { method: 'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body: new URLSearchParams({ action:'register', credential: credentialJSON, keyName: 'My Device' }) }); const result = await res.json(); document.getElementById('passkey-msg').innerText = result.message; } catch(e) { document.getElementById('passkey-msg').innerText = 'Error: ' + e; } } async function loginWithPasskey() { const username = document.getElementById('username').value; const res = await fetch('/controllers/pages/passkey.php', { method: 'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body: new URLSearchParams({ action:'login', username }) }); const data = await res.json(); if(data.status != 'success') { document.getElementById('passkey-msg').innerText = data.message; return; } const assertion = await navigator.credentials.get({ publicKey: { challenge: Uint8Array.from(atob(data.challenge), c=>c.charCodeAt(0)) } }); const assertionJSON = JSON.stringify(assertion); const verifyRes = await fetch('/controllers/pages/passkey.php', { method: 'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body: new URLSearchParams({ action:'verify', user_id:data.user_id, credential: assertionJSON }) }); const result = await verifyRes.json(); document.getElementById('passkey-msg').innerText = result.message; } </script> {include file='_footer.tpl'} composer require web-auth/webauthn-lib Try at your own risk. Give feedback wherether it works for you or not.
View Discussion0 Comments 0 Shares 4K Views 0 Reviews1
-
free do not sell your datafree do not sell your dataFile Type: zip0 Comments 0 Shares 3K Views 0 Reviews1
-
If Walls Could Talk: An Intimate History of the Home
Dr. Laura Markham, Lucy Worsley
$14.40
https://scriptstribe.com/books/view/if-walls-could-talk-an-intimate-history-of-the-home📚 If Walls Could Talk: An Intimate History of the Home Dr. Laura Markham, Lucy Worsley $14.40 https://scriptstribe.com/books/view/if-walls-could-talk-an-intimate-history-of-the-home0 Comments 0 Shares 3K Views 0 Reviews