Skip to content

Commit

Permalink
Merge branch 'master' into feature/new-session-class
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Jun 20, 2019
2 parents 4abb6d8 + 635d09b commit 4ce62eb
Show file tree
Hide file tree
Showing 22 changed files with 421 additions and 184 deletions.
Expand Up @@ -56,7 +56,7 @@
<dd class="controls_text"><input type="checkbox" name="draft_flag" id="sp-editor-draft_flag" class="uk-checkbox" {draft_flag_checked}{xhtml}></dd>

<dt><label for="sp-editor-cache_time">{lang_cache_time}</label></dt>
<dd><input type="text" size="8" value="{cache_time}" name="cache_time" id="sp-editor-cachetime" class="uk-input uk-form-width-xsmall"{xhtml}></dd>
<dd><input type="text" size="8" value="{cache_time}" name="cache_time" id="sp-editor-cachetime" class="uk-input uk-form-width-small"{xhtml}></dd>
<dd class="description">{lang_cache_time_desc}</dd>

<dt><label for="sp-editor-sp_onlastupdate">{lang_lastupdated}</label></dt>
Expand Down
Expand Up @@ -89,7 +89,7 @@
<dd class="controls_text"><input type="checkbox" name="draft_flag" id="sp-advanced_editor-draft_flag" class="uk-checkbox" {draft_flag_checked}{xhtml}></dd>

<dt><label for="sp-advanced_editor-cache_time">{lang_cache_time}</label></dt>
<dd><input type="text" value="{cache_time}" name="cache_time" id="sp-advanced_editor-cachetime" class="uk-input uk-form-width-xsmall"{xhtml}></dd>
<dd><input type="text" value="{cache_time}" name="cache_time" id="sp-advanced_editor-cachetime" class="uk-input uk-form-width-small"{xhtml}></dd>
<dd class="description">{lang_cache_time_desc}</dd>

<dt><label for="sp-editor-sp_onlastupdate">{lang_lastupdated}</label></dt>
Expand Down
15 changes: 14 additions & 1 deletion public_html/admin/install/devel-db-update.php
Expand Up @@ -89,17 +89,30 @@ function update_DatabaseFor221()
$_SQL[] = "ALTER TABLE {$_TABLES['stories']} ADD `modified` DATETIME NULL DEFAULT NULL AFTER `date`";

// New Likes System table
$_SQL[] ="
$_SQL[] = "
CREATE TABLE IF NOT EXISTS {$_TABLES['likes']} (
lid INT(11) NOT NULL AUTO_INCREMENT,
type varchar(30) NOT NULL,
subtype varchar(30) NOT NULL,
id varchar(30) NOT NULL,
uid MEDIUMINT NOT NULL,
ipaddress VARCHAR(39) NOT NULL,
action TINYINT NOT NULL,
created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (lid)
) ENGINE=MyISAM
";

// Add subtype column to topic assignments table to allow plugins to have topics specified for types of objects
$_SQL[] = "ALTER TABLE {$_TABLES['topic_assignments']} ADD `subtype` VARCHAR(30) NOT NULL DEFAULT '' AFTER `type`";
$_SQL[] = "
ALTER TABLE {$_TABLES['topic_assignments']}
DROP PRIMARY KEY,
ADD PRIMARY KEY(
`tid`,
`type`,
`subtype`,
`id`);
";

// ***************************************
Expand Down
18 changes: 15 additions & 3 deletions public_html/index.php
Expand Up @@ -114,9 +114,21 @@ function fixTopic(&$A, $tid_list)
$page = (int) COM_getArgument('page');
}
} elseif ($_CONF['url_rewrite'] && $_CONF['url_routing']) {
COM_setArgNames(array('topic', 'page'));
$topic = COM_getArgument('topic');
$page = (int) COM_getArgument('page');
// NOTE: this does not work if site_url config option contains a directory as URL class has issues grabing variables
// See: https://github.com/Geeklog-Core/geeklog/issues/937
COM_setArgNames(array('topic', 'page'));
$topic = COM_getArgument('topic');
$page = (int) COM_getArgument('page');
/*
// NOTE: $_URL->numArguments() currently does not work with URL Routing so cannot use yet like below...
// If on homepage will have less arguments so no need to grab variables.
// Cannot use COM_onFrontpage here as it requires global $topic variable to be already set
if ($_URL->numArguments() > 1) { // see if at least topic is set (or what we assume as topic)
COM_setArgNames(array('topic', 'page'));
$topic = COM_getArgument('topic');
$page = (int) COM_getArgument('page');
}
*/
} else {
$topic = Geeklog\Input::fGet('topic', Geeklog\Input::fPost('topic', ''));
$page = (int) Geeklog\Input::get('page', 0);
Expand Down
16 changes: 9 additions & 7 deletions public_html/javascript/likes_control.js
Expand Up @@ -31,12 +31,13 @@ $(document).ready(function(){
$(document).on('click', '.gl-like-btn, .gl-dislike-btn', function(event) {
event.preventDefault(); // Prevent link click from calling likes.php

var item_type = $(this).data('type');
var type = $(this).data('type');
var sub_type = $(this).data('subtype');
var item_id = $(this).data('id');
$clicked_btn = $(this);

// Disable Clicks and mute colors on buttons until finished
$("#likes-"+item_type+'-'+item_id).attr("style", "opacity:0.2; pointer-events: none;");
$("#likes-"+type+'-'+sub_type+'-'+item_id).attr("style", "opacity:0.2; pointer-events: none;");

// Determine type of like action (what button type pressed)
if ($clicked_btn.hasClass('gl-like-action')) {
Expand All @@ -55,12 +56,13 @@ $(document).ready(function(){
data: {
'a': "1",
'action': action,
'type': item_type,
'type': type,
'subtype': sub_type,
'id': item_id
},
beforeSend: function(){
// Show loading image container
//$("#likes-loader-"+item_type+'-'+item_id).show();
//$("#likes-loader-"+type+'-'+sub_type+'-'+item_id).show();
},
success: function(data){
res = JSON.parse(data);
Expand All @@ -71,7 +73,7 @@ $(document).ready(function(){
alert(res.data);
} else {
// Copy over Likes control with new data
$('#likes-'+item_type+'-'+item_id).prop('outerHTML', res.data);
$('#likes-'+type+'-'+sub_type+'-'+item_id).prop('outerHTML', res.data);
}
},
error: function(error){
Expand All @@ -83,10 +85,10 @@ $(document).ready(function(){
},
complete: function(data){
// Hide image loading container
//$("#likes-loader-"+item_type+'-'+item_id).hide();
//$("#likes-loader-"+type+'-'+sub_type+'-'+item_id).hide();

// Fix opacity and clicks incase error or error message returned from success
$("#likes-"+item_type+'-'+item_id).attr("style", "opacity:1.0; pointer-events: auto;");
$("#likes-"+type+'-'+sub_type+'-'+item_id).attr("style", "opacity:1.0; pointer-events: auto;");

}
});
Expand Down
6 changes: 3 additions & 3 deletions public_html/layout/denim/controls/likes.thtml
@@ -1,12 +1,12 @@
{# start {templatelocation} #}

<span class="gl-likes" id="likes-{item_type}-{item_id}">
<span class="gl-likes" id="likes-{item_type}-{item_sub_type}-{item_id}">
{# Actions in URL: Like = 1, Dislike = 2, Unlike = 3, Undislike = 4 #}
{# Required classes for identification needed for JS: gl-like-btn gl-like-action gl-unlike-action gl-like-num gl-dislike-btn gl-dislike-action gl-undislike-action gl-dislike-num gl-likes-message #}

{!if action_enabled}
{# if user likes item, style button differently #}
<a href="{site_url}/likes.php?type={item_type}&id={item_id}{!if user_liked}&action=3" class="uk-icon-thumbs-up uk-icon-small gl-like-btn gl-unlike-action"{!else}&action=1" class="uk-icon-thumbs-o-up uk-icon-small gl-like-btn gl-like-action"{!endif} rel="nofollow" data-type="{item_type}" data-id="{item_id}" data-uk-tooltip title="{lang_like_action}"></a>
<a href="{site_url}/likes.php?type={item_type}&subtype={item_sub_type}&id={item_id}{!if user_liked}&action=3" class="uk-icon-thumbs-up uk-icon-small gl-like-btn gl-unlike-action"{!else}&action=1" class="uk-icon-thumbs-o-up uk-icon-small gl-like-btn gl-like-action"{!endif} rel="nofollow" data-type="{item_type}" data-subtype="{item_sub_type}" data-id="{item_id}" data-uk-tooltip title="{lang_like_action}"></a>
{!else}
<span class="{!if user_liked}uk-icon-thumbs-up{!else}uk-icon-thumbs-o-up{!endif} uk-icon-small" data-uk-tooltip title="{lang_like_action}"></span>
{!endif}
Expand All @@ -17,7 +17,7 @@

{!if action_enabled}
{# if user dislikes item, style button differently #}
<a href="{site_url}/likes.php?type={item_type}&id={item_id}{!if user_disliked}&action=4" class="uk-icon-thumbs-down uk-icon-small gl-dislike-btn gl-undislike-action"{!else}&action=2" class="uk-icon-thumbs-o-down uk-icon-small gl-dislike-btn gl-dislike-action"{!endif} rel="nofollow" data-type="{item_type}" data-id="{item_id}" data-uk-tooltip title="{lang_dislike_action}"></a>
<a href="{site_url}/likes.php?type={item_type}&subtype={item_sub_type}&id={item_id}{!if user_disliked}&action=4" class="uk-icon-thumbs-down uk-icon-small gl-dislike-btn gl-undislike-action"{!else}&action=2" class="uk-icon-thumbs-o-down uk-icon-small gl-dislike-btn gl-dislike-action"{!endif} rel="nofollow" data-type="{item_type}" data-subtype="{item_sub_type}" data-id="{item_id}" data-uk-tooltip title="{lang_dislike_action}"></a>
{!else}
<span class="{!if user_liked}uk-icon-thumbs-down{!else}uk-icon-thumbs-o-down{!endif} uk-icon-small" data-uk-tooltip title="{lang_dislike_action}"></span>
{!endif}
Expand Down
Expand Up @@ -34,10 +34,10 @@
<dd class="description" id="desc-admin-storyeditor-publish_month">{publish_date_explanation}</dd>

<dt><label for="admin-storyeditor-title">{lang_title}</label></dt>
<dd><input type="text" maxlength="128" {!if titletoid}onkeyup="TitleToId('admin-storyeditor-title','admin-storyeditor-sid');" {!endif}value="{story_title}" name="title" id="admin-storyeditor-title" class="uk-input size6"{xhtml}></dd>
<dd><input type="text" maxlength="128" {!if titletoid}onkeyup="TitleToId('admin-storyeditor-title','admin-storyeditor-sid');" {!endif}value="{story_title}" name="title" id="admin-storyeditor-title" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt><label for="admin-storyeditor-page_title">{lang_page_title}</label></dt>
<dd><input type="text" maxlength="128" value="{page_title}" name="page_title" id="admin-storyeditor-page_title" class="uk-input size6"{xhtml}></dd>
<dd><input type="text" maxlength="128" value="{page_title}" name="page_title" id="admin-storyeditor-page_title" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt><label for="tid">{lang_topic}</label></dt>
<dd class="controls_text">{topic_selection}</dd>
Expand All @@ -52,7 +52,7 @@
</dd>

<dt><label for="admin-storyeditor-cachetime">{lang_cachetime}</label></dt>
<dd><input type="text" size="8" value="{cache_time}" name="cache_time" id="admin-storyeditor-cachetime" class="uk-input text" aria-describedby="desc-admin-storyeditor-cachetime"{xhtml}></dd>
<dd><input type="text" value="{cache_time}" name="cache_time" id="admin-storyeditor-cachetime" class="uk-input uk-form-width-small" aria-describedby="desc-admin-storyeditor-cachetime"{xhtml}></dd>
<dd class="description" id="desc-admin-storyeditor-cachetime">{lang_cachetime_desc}</dd>

<dt><label for="admin-storyeditor-draft_flag">{lang_draft}</label></dt>
Expand Down Expand Up @@ -137,7 +137,7 @@
</dd>

<dt><label for="admin-storyeditor-sid">{lang_sid}</label></dt>
<dd><input type="text" maxlength="128" value="{story_id}" name="sid" id="admin-storyeditor-sid" class="uk-input size5"{xhtml}></dd>
<dd><input type="text" maxlength="128" value="{story_id}" name="sid" id="admin-storyeditor-sid" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt{hide_meta}><label for="admin-storyeditor-metadescription">{lang_metadescription}</label></dt>
<dd{hide_meta}><textarea cols="70" rows="2" name="meta_description" id="admin-storyeditor-metadescription" class="uk-textarea wide">{meta_description}</textarea></dd>
Expand Down
Expand Up @@ -13,13 +13,13 @@
<dd class="controls_text">{story_author}</dd>

<dt><label for="admin-storyeditor_advanced-title">{lang_title}</label></dt>
<dd><input type="text" maxlength="128" {!if titletoid}onkeyup="TitleToId('admin-storyeditor_advanced-title','admin-storyeditor_advanced-sid');" {!endif}value="{story_title}" name="title" id="admin-storyeditor_advanced-title" class="uk-input size6"{xhtml}></dd>
<dd><input type="text" maxlength="128" {!if titletoid}onkeyup="TitleToId('admin-storyeditor_advanced-title','admin-storyeditor_advanced-sid');" {!endif}value="{story_title}" name="title" id="admin-storyeditor_advanced-title" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt><label for="admin-storyeditor-page_title">{lang_page_title}</label></dt>
<dd><input type="text" maxlength="128" value="{page_title}" name="page_title" id="admin-storyeditor-page_title" class="uk-input size6"{xhtml}></dd>
<dd><input type="text" maxlength="128" value="{page_title}" name="page_title" id="admin-storyeditor-page_title" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt><label for="admin-storyeditor_advanced-sid">{lang_sid}</label></dt>
<dd><input type="text" maxlength="128" value="{story_id}" name="sid" id="admin-storyeditor_advanced-sid" class="uk-input size6"{xhtml}></dd>
<dd><input type="text" maxlength="128" value="{story_id}" name="sid" id="admin-storyeditor_advanced-sid" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt{hide_meta}><label for="admin-storyeditor-metadescription">{lang_metadescription}</label></dt>
<dd{hide_meta}><textarea name="meta_description" id="admin-storyeditor-metadescription" class="uk-textarea" style="width:95%" cols="70" rows="2">{meta_description}</textarea></dd>
Expand All @@ -40,7 +40,7 @@
</dd>

<dt><label for="admin-storyeditor_advanced-cachetime">{lang_cachetime}</label></dt>
<dd><input type="text" size="8" value="{cache_time}" name="cache_time" id="admin-storyeditor_advanced-cachetime" class="uk-input text" aria-describedby="desc-admin-storyeditor_advanced-cachetime"{xhtml}></dd>
<dd><input type="text" value="{cache_time}" name="cache_time" id="admin-storyeditor_advanced-cachetime" class="uk-input uk-form-width-small" aria-describedby="desc-admin-storyeditor_advanced-cachetime"{xhtml}></dd>
<dd class="description" id="desc-admin-storyeditor_advanced-cachetime">{lang_cachetime_desc}</dd>

<dt><label for="admin-storyeditor_advanced-draft_flag">{lang_draft}</label></dt>
Expand Down
20 changes: 10 additions & 10 deletions public_html/layout/denim_three/admin/block/blockeditor.thtml
Expand Up @@ -6,20 +6,20 @@
<div class="admin_basic">
<dl class="form_block">
<dt><label for="admin-blockeditor-title">{lang_blocktitle}</label></dt>
<dd><input type="text" value="{block_title}" name="title" id="admin-blockeditor-title" class="uk-input size5"{xhtml}></dd>
<dd><input type="text" value="{block_title}" name="title" id="admin-blockeditor-title" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt><label for="admin-blockeditor-is_enabled">{lang_enabled}</label></dt>
<dd class="controls_text"><input type="checkbox" {is_enabled} name="is_enabled" id="admin-blockeditor-is_enabled" class="uk-checkbox"{xhtml}></dd>

<dt><label for="admin-blockeditor-help">{lang_blockhelpurl}</label></dt>
<dd>
<input type="text" value="{block_help}" name="help" id="admin-blockeditor-help" class="uk-input size5" aria-describedby="desc-admin-blockeditor-help1 desc-admin-blockeditor-help2"{xhtml}>
<input type="text" value="{block_help}" name="help" id="admin-blockeditor-help" class="uk-input uk-form-width-large" aria-describedby="desc-admin-blockeditor-help1 desc-admin-blockeditor-help2"{xhtml}>
</dd>
<dd id="desc-admin-blockeditor-help1" class="description">{lang_includehttp}</dd>
<dd id="desc-admin-blockeditor-help2" class="description">{lang_explanation}</dd>

<dt><label for="admin-blockeditor-name">{lang_blockname}</label></dt>
<dd><input type="text" value="{block_name}" name="name" id="admin-blockeditor-name" class="uk-input size5" aria-describedby="desc-admin-blockeditor-name"{xhtml}></dd>
<dd><input type="text" value="{block_name}" name="name" id="admin-blockeditor-name" class="uk-input uk-form-width-medium" aria-describedby="desc-admin-blockeditor-name"{xhtml}></dd>
<dd id="desc-admin-blockeditor-name" class="description">{lang_nospaces}</dd>

<dt><label>{lang_topic}</label></dt>
Expand All @@ -36,7 +36,7 @@
</dd>

<dt><label for="admin-blockeditor-blockorder">{lang_blockorder}</label></dt>
<dd><input type="text" value="{block_order}" name="blockorder" id="admin-blockeditor-blockorder" class="uk-input size1" aria-describedby="desc-admin-blockeditor-blockorder"{xhtml}></dd>
<dd><input type="text" value="{block_order}" name="blockorder" id="admin-blockeditor-blockorder" class="uk-input uk-form-width-xsmall" aria-describedby="desc-admin-blockeditor-blockorder"{xhtml}></dd>
<dd id="desc-admin-blockeditor-blockorder" class="description">0-9999</dd>

<dt><label>{lang_device}</label></dt>
Expand All @@ -57,15 +57,15 @@
</dd>

<dt><label for="admin-blockeditor-cachetime">{lang_cachetime}</label></dt>
<dd><input type="text" size="8" value="{cache_time}" name="cache_time" id="admin-blockeditor-cachetime" class="uk-input size1" aria-describedby="desc-admin-blockeditor-cachetime"{xhtml}></dd>
<dd><input type="text"value="{cache_time}" name="cache_time" id="admin-blockeditor-cachetime" class="uk-input uk-form-width-small" aria-describedby="desc-admin-blockeditor-cachetime"{xhtml}></dd>
<dd id="desc-admin-blockeditor-cachetime" class="description">{lang_cachetime_desc}</dd>

<dt><label for="admin-blockeditor-css-id">{lang_css_id}</label></dt>
<dd><input type="text" value="{css_id}" name="css_id" id="admin-blockeditor-css-id" class="uk-input size5" aria-describedby="desc-admin-blockeditor-css-id"{xhtml}></dd>
<dd><input type="text" value="{css_id}" name="css_id" id="admin-blockeditor-css-id" class="uk-input uk-form-width-medium" aria-describedby="desc-admin-blockeditor-css-id"{xhtml}></dd>
<dd id="desc-admin-blockeditor-css-id" class="description">{lang_css_id_desc}</dd>

<dt><label for="admin-blockeditor-css-classes">{lang_css_classes}</label></dt>
<dd><input type="text" value="{css_classes}" name="css_classes" id="admin-blockeditor-css-classes" class="uk-input size5" aria-describedby="desc-admin-blockeditor-css-classes"{xhtml}></dd>
<dd><input type="text" value="{css_classes}" name="css_classes" id="admin-blockeditor-css-classes" class="uk-input uk-form-width-large" aria-describedby="desc-admin-blockeditor-css-classes"{xhtml}></dd>
<dd id="desc-admin-blockeditor-css-classes" class="description">{lang_css_classes_desc}</dd>
</dl>

Expand All @@ -74,7 +74,7 @@

<dl class="form_block">
<dt><label for="admin-blockeditor-phpblockfn">{lang_blockfunction}</label></dt>
<dd><input type="text" maxlength="50" value="{block_phpblockfn}" name="phpblockfn" id="admin-blockeditor-phpblockfn" class="uk-input size5" aria-describedby="desc-admin-blockeditor-phpblockfn"{xhtml}></dd>
<dd><input type="text" maxlength="50" value="{block_phpblockfn}" name="phpblockfn" id="admin-blockeditor-phpblockfn" class="uk-input uk-form-width-medium" aria-describedby="desc-admin-blockeditor-phpblockfn"{xhtml}></dd>
<dd id="desc-admin-blockeditor-phpblockfn" class="description">{lang_phpblockwarning}</dd>
</dl>
</fieldset>
Expand All @@ -84,10 +84,10 @@

<dl class="form_block">
<dt><label for="admin-blockeditor-rdfurl">{lang_rdfurl}</label></dt>
<dd><input type="text" maxlength="{max_url_length}" value="{block_rdfurl}" name="rdfurl" id="admin-blockeditor-rdfurl" class="uk-input size5"{xhtml}></dd>
<dd><input type="text" maxlength="{max_url_length}" value="{block_rdfurl}" name="rdfurl" id="admin-blockeditor-rdfurl" class="uk-input uk-form-width-large"{xhtml}></dd>

<dt><label for="admin-blockeditor-rdflimit">{lang_rdflimit}</label></dt>
<dd><input type="text" maxlength="3" value="{block_rdflimit}" name="rdflimit" id="admin-blockeditor-rdflimit" class="uk-input size1"{xhtml}></dd>
<dd><input type="text" maxlength="3" value="{block_rdflimit}" name="rdflimit" id="admin-blockeditor-rdflimit" class="uk-input uk-form-width-xsmall"{xhtml}></dd>

<dt><label for="admin-blockeditor-rdfupdated">{lang_lastrdfupdate}</label></dt>
<dd>{block_rdfupdated}</dd>
Expand Down

0 comments on commit 4ce62eb

Please sign in to comment.