This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $db; | |
$upload_dir = get_misc_data('upload_directory'); | |
$thumb_dir = get_misc_data('upload_thdirectory'); | |
$link_id = $this->_vars['link_id']; | |
$sql = sprintf("SELECT file_name FROM " . table_prefix . "files WHERE file_link_id='%d' AND file_size='240x650' AND file_comment_id=0", $link_id); | |
if ($thumbnail = $db->get_var($sql)) { | |
echo "<img src='". my_pligg_base . $thumb_dir ."/$thumbnail'> "; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Here is the function, drop it in your functions.php file | |
*/ | |
function auto_login( $user ) { | |
$username = $user; | |
if ( !is_user_logged_in() ) { | |
$user = get_userdatabylogin( $username ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* If you, by any chance, want to limit the number of posts an user can create in your multi author WordPress blog, there is a nice way to do it. Add the following code in your theme’s functions.php file | |
*/ | |
add_action("load-post-new.php","limit_user_by_post_count"); | |
function limit_user_by_post_count(){ | |
$user = get_current_user_id(); | |
if (!current_user_can( 'manage_options')) { | |
//not an admin - so impose the limit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A UNIX / Linux shell script to backup dirs to tape device like /dev/st0 (linux) | |
# This script make both full and incremental backups. | |
# You need at two sets of five tapes. Label each tape as Mon, Tue, Wed, Thu and Fri. | |
# You can run script at midnight or early morning each day using cronjons. | |
# The operator or sys admin can replace the tape every day after the script has done. | |
# Script must run as root or configure permission via sudo. | |
# ------------------------------------------------------------------------- | |
# Copyright (c) 1999 Vivek Gite <[email protected]> | |
# This script is licensed under GNU GPL version 2.0 or above | |
# ------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script to backup MySql database | |
# To backup MySql databases file to /backup directory and later pick up by your | |
# script. You can skip few databases from backup too. | |
# For more info please see (Installation info): | |
# http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html | |
# Last updated: Nov - 2013 | |
# -------------------------------------------------------------------- | |
# This is a free shell script under GNU GPL version 2.0 or above | |
# Copyright (C) 2004, 2005 nixCraft project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# WordPress Sandbox | |
# palPalani | |
# m3webware.com | |
# requires wp-cli | |
# usage: wordpress-sandbox | |
# or: ./wordpress-sandbox.sh | |
# Download WordPress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Monitor CentMinMod (https://community.centminmod.com/) server using Monit | |
//Mmonit 5.14 - http://mmonit.com/monit/ | |
//How to: http://mmonit.com/wiki/Monit/HowTo | |
//Real-world configuration examples - http://mmonit.com/wiki/Monit/ConfigurationExamples | |
//Pushover notifications - http://mmonit.com/wiki/MMonit/Notification | |
//About Monit | |
Monit is a helpful program that automatically monitors and manages server programs to ensure that they not only stay online consistently, but that the file size, checksum, or permissions are always correct. Additionally monit comes with a basic web interface through which all of the processes can be set up. This tutorial will cover the most basic setup and configuration. | |
//Install Monit on CentOS 6.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Creating admin user account for WordPress using PhpMyAdmin. | |
Please make the following changes and then run this SQL. | |
*** Change the Database name 'yourdbname'. | |
*** Change table names 'wp_users' and 'wp_usermeta' and also change 'wp_capabilities' and 'wp_user_level' according to table prefix. | |
*** Change username 'palpalani' and password 'password' | |
*** Change ID to whatever you need | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 1. create wp plugin for pligg | |
* 2. create file wpconnect.php at pligg root | |
*/ | |
$pligg_url = ''; | |
$pligg_path = ''; | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
I've managed to get Pligg to use WordPress authentication and user database. | |
I recently got Pligg using Pubcookie and that formed the basis of this work, however they are very different. | |
I've only tested this with Pligg. I believe future versions may have a better approach for external authentication so I can't guarantee this will work with future versions. | |
This approach is very "hacky". I've also been slightly lazy. It assumes that you will use WordPress' login, logout and register pages. This will break the existing login, logout and register forms in Pligg. The ultimate solution would allow the Pligg forms to login and logout also on WordPress and the register form to create new users in WordPress. |