Skip to content

Instantly share code, notes, and snippets.

Alejandro Schmeichler jreviews

Block or report user

Report or block jreviews

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jreviews
jreviews / user-profiles-listing-outside-jreviews.php
Last active May 12, 2020
Get user profile listing array outside JReviews
View user-profiles-listing-outside-jreviews.php
// Use the Joomla OR the WordPress path, NOT both
// Joomla path
require_once JPATH_ROOT.'/components/com_jreviews/jreviews/framework.php';
// WordPress Path
require_once ABSPATH.'/wp-content/plugins/jreviews/jreviews/framework.php';
S2App::import('Component','userprofiles_profile','jreviews');
View categories_controller_macros.php
<?php
defined('MVC_FRAMEWORK') or die;
CategoriesController::macro('favorites_override', function()
{
$userId = $this->auth->id;
if ( !$userId )
{
return $this->renderSignUpPage();
View Using Git to Manage a Live Web Site.md

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@jreviews
jreviews / dev-filter-set-session-init-select2.php
Last active Mar 17, 2020
Load Listing Images in FormBuilder
View dev-filter-set-session-init-select2.php
<?php
defined('MVC_FRAMEWORK') or die;
function listing_form_select2($viewVars, $params)
{
$asset_manager = S2Object::make('asset_manager');
$asset_manager->add('jquery/select2.min.js','core');
$listingId = $viewVars['listing']['Listing']['listing_id'];
@jreviews
jreviews / close-future-event-reviews.php
Created Mar 8, 2020
Close reviews for future events
View close-future-event-reviews.php
<?php
defined('MVC_FRAMEWORK') or die;
function close_future_event_reviews($open, $params)
{
$listing = $params['listing'];
$fieldName = 'jr_eventstartdate';
if ( !empty($listing['Field']['pairs'][$fieldName]['value'][0]) && $listing['Field']['pairs'][$fieldName]['value'][0] > date("Y-m-d H:i:s") )
@jreviews
jreviews / field-php-output-format.php
Created Mar 7, 2020
Show more for textarea custom fields
View field-php-output-format.php
return '<div class="jr-show-more" data-characters="50">'.nl2br(strip_tags($text)).'</div>';
@jreviews
jreviews / cloudflare_thumbnails.php
Last active Mar 8, 2020
Developer filter to generate thumbnails with the CloudFlare Image CDN
View cloudflare_thumbnails.php
<?php
defined('MVC_FRAMEWORK') or die;
/**
* Re-writes image URLs to the CloudFlare Image CDN
* https://developers.cloudflare.com/images/about/
*/
function jreviews_cloudflare_cdn_thumbnails ($attr, $params = [])
{
// Skip if thumbnails are not yet generated
@jreviews
jreviews / icon-svg-override.css
Created Mar 1, 2020
Override CSS font icons with SVGs
View icon-svg-override.css
.jrIconEditor {
width: 16px;
height: 16px;
display: inline-block;
background-size: 16px 16px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234a5568' class='w-8 h-8'%3E%3Cpath fill-rule='evenodd' d='M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z' clip-rule='evenodd'%3E%3C/path%3E%3C/svg%3E");
}
.jrIconEditor:before {
content: unset;
}
@jreviews
jreviews / bitpixels_image.php
Last active Feb 25, 2020
Insert bitpixels image in listing lists, listings module and listing detail pages.
View bitpixels_image.php
<?php
defined('MVC_FRAMEWORK') or die;
function bitpixels_thumbnail($listings, $params)
{
if ( $params['controller'] == 'com_content' )
{
$listings = [$listings];
}
View jreviews_overrides|events|listeners|update_listing_average_price.php
<?php
namespace JReviews\Listeners;
defined( 'MVC_FRAMEWORK') or die;
use JReviews\Listeners\Traits\ListenerSetting;
use Clickfwd\Listener\QueueableListener;
use League\Event\EventInterface;
use GuzzleHttp\Client as Guzzle;
You can’t perform that action at this time.