Skip to content

Instantly share code, notes, and snippets.

View iainurquhart's full-sized avatar

Iain Urquhart iainurquhart

View GitHub Profile
// find the following around line 127 of pi.imgsizer.php
// -------------------------------------
// do fetch remote img and reset the src
// -------------------------------------
if($remote && $img['url_src']){
$img['src'] = $this->do_remote($img);
}
// immediately after that, enter the following
<div class="fm-profile-detail-wrapper">
<div class="fm-header-wrapper">
<div class="fm-member-photo{if photo} fm-has-photo{/if}">
{if photo}
<img src="{path:photo_url}" class="photo" width="{photo_width}" height="{photo_height}" border="0" title="{name}" />
<p>{lang:my_photo}</p>
{/if}
{if not_photo}
<img src="{path:image_url}icon_profile.gif" width="50" height="50" border="0" title="{name}" alt="{lang:no_photo}" />
<p>{lang:no_photo_exists}</p>
Say you had your "add to favorites" link as so:
<p class="bookmark_link">
<a class="favorites_trigger" href="{path=/favorites/add/}{entry_id}">
Bookmark this
</a>
</p>
==========================================================
@iainurquhart
iainurquhart / 'Pages' Boilerplate
Created January 22, 2011 01:43
Iain's standard static content field map in EE
{exp:channel:entries
channel="pages_about"
limit="1"
status="open"
disable="{global:param_disable_default}"
require_entry="yes"} {if no_results}{redirect="404"}{/if}
{gv_html_open}
<title>{title}</title>
{snp_head_links}
</head>
@iainurquhart
iainurquhart / gist:954618
Created May 4, 2011 02:01
Example Mapping of file upload dirs and sql queries for EE1 ngen to EE2 file fields
UPLOAD DIRECTORIES
id label
------------------------------
10 Career Uploads
11 Consumer Line
5 Content Resources
13 Form Uploads
9 Hero Images
12 Home Page Banner Uploads
@iainurquhart
iainurquhart / gist:1068770
Created July 7, 2011 02:08
Importing/updating via the channel_entries api
<?php
// a bunch of stuff up here that fetches/preps the external data
// basically create an array with all your data to insert / update
$data = array(
'title' => $operator['nameofbusiness'],
'entry_date' => date("Y-m-d h:i A", $entry_date),
'channel_id' => $channel_id,
'category' => array($category_id),
<?php
/**
* If not currently logged in, login temp superadmin
*
* @access public
*/
function login_temporary_user()
{
if( $this->EE->session->userdata['member_id'] == 0) {
$this->table->set_heading(
array('data' => lang('id'), 'colspan' => '6')
);
$this->table->add_row(
array('data' => $data,
'colspan' => '6',
'style' => 'background: #fff; border-bottom-width: 10px;')
);
@iainurquhart
iainurquhart / gist:1182497
Created August 31, 2011 00:18
taxonomy bugfix
FROM LINE 182 to 194 OF: system/expressionengine/third_party/taxonomy/mcp.taxonomy.php
// build our member_groups array for our multiselect options
foreach( $member_groups as $member_group )
{
// only add to the array if the member group can actuall access the taxonomy module
if( $this->EE->ttree->can_access_taxonomy($member_group['group_id']) )
{
@iainurquhart
iainurquhart / gist:1244591
Created September 27, 2011 08:17
Pointee Example
<style type="text/css">
.image {position: relative;}
.image span {
position: absolute;
background: red;
width: 15px;
height: 15px;
border-radius: 15px;
}
</style>