Skip to content

Instantly share code, notes, and snippets.

@Jimmi08
Jimmi08 / .htaccess
Created January 25, 2018 08:19 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@Jimmi08
Jimmi08 / link_pdf_attachment.php
Created September 8, 2017 14:00 — forked from pommiegranit/link_pdf_attachment.php
Simple plugin to add a link to the top of a WordPress post to any PDF attachment
<?php
// Configuration ---------------------- //
$repo = "e107inc/e107";
$branch = "master";
// ------------------------------------ //
$git = simplexml_load_file("https://github.com/".$repo."/commits/".$branch.".atom");

Ajax API - Ajax Forms in e107

Ajax-enabled forms in e107 offer dynamic form behavior with no page reloads and are easy to create and manipulate. They are a simple extension of the e107 Form API.

What is dynamic behavior? Traditional web behavior has the user fill in a form, click a button, and the entire page is rebuilt and sent back to the browser. Ajax-enabled forms update or replace part of the page or part of the form without doing a full page reload - only the part that needs to be changed is changed. It's more responsive to the user and typically faster than the traditional page reload approach.

Some facts about Ajax:

  • Ajax forms provide dynamic form behavior without page reloads.
  • As a developer you don't use or touch any JavaScript to create an Ajax-enabled form. E107 does all the work for you.
  • Most of the time, Ajax-enabled forms are just dynamic replacement of an HTML region on the page, which is most often a piece of a rebuilt form.

Using Newer Versions of jQuery in e107

You will often need a newer version of jQuery to use a certain jQuery plugin. There are two ways to achieve this.

Method 1: Using theme_library.php addon file in your theme folder

<?php

/**
@Jimmi08
Jimmi08 / e107_cpg15x.inc.php
Created June 14, 2017 12:26 — forked from chipviled/e107_cpg15x.inc.php
Bridge e107 (v 1.x and 2.x) and cpg (v1.5.x only)
<?php
/********************************************************************
Coppermine Photo Gallery
e107 bridge
************************
v1.01
Coppermine version: 1.4.9
$Source$
$Author: v3 <[email protected]>$
<?php
define("e107_INIT", TRUE);
$chwd = realpath(dirname(__FILE__));
$e107_config = $chwd . '/e107_config.php';
include_once($e107_config);
$e107_version = $chwd . '/' . $ADMIN_DIRECTORY . 'ver.php';
@Jimmi08
Jimmi08 / Twitter_menu.php
Created June 14, 2017 10:37 — forked from Floryn/Twitter_menu.php
twitter menu for e107
<?php
if (!defined('e107_INIT')) { exit; }
$html = <<<END_OF_HTML
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 3,
interval: 30000,