Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

René Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / sitesinfo.php
Last active February 22, 2018 00:50
Watchful.li site overview through API
<?php
/**
* @package Watchful.li siteoverzicht
* @author Rene Kreijveld, based on the original work of Watchful.li
* @authorUrl https://about.me/renekreijveld
* @copyright (c) 2016, Rene Kreijveld
*/
//Config
define('API_KEY', 'plaats-jouw-watchful.li-api-key-hier');
Verifying that +renekreijveld is my blockchain ID. https://onename.com/renekreijveld
@renekreijveld
renekreijveld / joomlaqueries.php
Last active February 22, 2018 00:51
DB queries
<?php
// Select record, all fields
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__table'))
->where($db->quoteName('id') . ' = '. (int) $searchId);
$db->setQuery($query);
$results = $db->loadObjectlist();
// Select record, specific fields
@renekreijveld
renekreijveld / searchlatlon.php
Last active August 29, 2015 14:23
Search lat/lom for address
$zoekadres = $l_adres." ".$l_postcode." ".$l_plaats." ".$l_land;
$zoekadres = urlencode($zoekadres);
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address={$zoekadres}";
$resp_json = file_get_contents($url);
$resp = json_decode($resp_json, true);
if($resp['status']=='OK') {
$lat = $resp['results'][0]['geometry']['location']['lat'];
$lng = $resp['results'][0]['geometry']['location']['lng'];
} else {
$lat = "";
@renekreijveld
renekreijveld / logic.php
Last active February 22, 2018 01:09
Logic.php to include in Joomla 3.x templates
<?php
// Template by DSD business internet // www.gakijken.nl //
defined('_JEXEC') or die;
// Connect with Joomla
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$session = JFactory::getSession();
// Get variables
@renekreijveld
renekreijveld / upgrade_2.5.7_to_3.3.6.sql
Last active August 29, 2015 14:16
Joomla database update 2.5.x to 3.3.6
-- Upgrade Joomla 2.5.7 database to Joomla 3.3.6 database
-- Written by: Rene Kreijveld
--
-- This script is provided "as is", without any accompanying services or warranties from Rene Kreijveld.
--
-- Please read these instructions carefully!
-- Before you de ANY update, migration or modification, make sure you have a working backup of your website(s)!
--
-- To use this script do the following:
--
@renekreijveld
renekreijveld / jdbrepair
Created October 17, 2014 18:55
Repair all tables of a joomla database.
#!/bin/sh
# jdbrepair -- Repair all tables of a joomla database.
#
# This scripts supports Joomla versions 1.0 - 3.3
#
# Copyright 2014 Rene Kreijveld - [email protected]
#
# This program is free software; you may redistribute it and/or modify it.
#
@renekreijveld
renekreijveld / jdbsession
Created October 17, 2014 18:55
Repair the session table of a Joomla database table.
#!/bin/sh
# jdbsession -- Repair the session table of a Joomla database table.
#
# This scripts supports Joomla versions 1.0 - 3.3
#
# Copyright 2014 Rene Kreijveld - [email protected]
#
# This program is free software; you may redistribute it and/or modify it.
#
@renekreijveld
renekreijveld / joomlainfo.cmd
Created October 15, 2014 13:24
Display Joomla 2.5+ website info for Windows
@ECHO OFF
REM Joomla info ophalen
call "jinfo.cmd" > nul
REM Output data
ECHO Sitename = %jsitename%
ECHO Host = %jhost%
ECHO Database = %jdb%
ECHO User = %juser%
@renekreijveld
renekreijveld / jinfo.cmd
Created October 15, 2014 13:24
Gather info about a Joomla 2.5+ installation for Windows
@ECHO OFF
REM Sitenaam ophalen
FOR /F "tokens=4" %%G IN ('FINDSTR /C:"$sitename =" configuration.php') DO (
FOR /F "tokens=1 delims='" %%A IN ('echo %%G') DO (
SET jsitename=%%A
)
)
REM Host ophalen