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
require 'mysql2' | |
require File.expand_path(File.dirname(__FILE__) + "/base.rb") | |
require 'htmlentities' | |
begin | |
require 'php_serialize' # https://github.com/jqr/php-serialize | |
rescue LoadError | |
puts | |
puts 'php_serialize not found.' | |
puts 'Add to Gemfile, like this: ' | |
puts |
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
{"site_customization":{"id":3,"name":"Change home logo","key":"a3b4338c-b5a9-4e19-959a-d4b1de267175","enabled":false,"created_at":"2016-09-29T20:55:52.874Z","updated_at":"2016-12-23T17:56:47.611Z","stylesheet":"","header":"","footer":"","top":"","mobile_stylesheet":"","mobile_header":"","mobile_footer":"","mobile_top":"","head_tag":"\u003cscript type=\"text/discourse-plugin\" version=\"0.2\"\u003e\n api.changeWidgetSetting('post-avatar', 'size', '140');\n api.changeWidgetSetting('home-logo', 'href', 'https://www.google.com/');\n\u003c/script\u003e","body_tag":"","embedded_css":""}} |
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
<script> | |
jQuery(document).ready(function($) { | |
var site = 'https://your.discourse.forum'; | |
var size = 50; | |
var data = $.getJSON(site + '/latest.json', function(data) { | |
var userArr = {}; | |
for(var i=0; i<data.users.length; i++) { | |
userArr[data.users[i].id] = data.users[i].avatar_template.replace('{size}',size); | |
} |