Changeset 1727679
- Timestamp:
- 09/10/2017 03:24:50 PM (9 years ago)
- Location:
- softmixt-relations/trunk
- Files:
-
- 3 added
- 1 deleted
- 6 edited
-
README.txt (modified) (4 diffs)
-
admin/assets/js/plugin-admin.js (modified) (2 diffs)
-
admin/assets/tinymce/plugins/sftrelations/plugin.js (modified) (3 diffs)
-
admin/assets/tinymce/plugins/sftrelations/plugin.min.js (modified) (1 diff)
-
admin/assets/tinymce/plugins/sftrelations/plugin.min.min.js (deleted)
-
public/public.php (modified) (3 diffs)
-
softmixt-relations.php (modified) (2 diffs)
-
widgets (added)
-
widgets/default (added)
-
widgets/default/SFT_DefaultWidget.php (added)
Legend:
- Unmodified
- Added
- Removed
-
softmixt-relations/trunk/README.txt
r1689256 r1727679 40 40 $item_container = $atts[ 'item_container' ]; 41 41 42 // Related item container title element (set on short code). 43 $item_title_container = $atts[ 'item_title_container' ]; 44 42 45 // Related item container class element (set on short code). 43 46 $item_container_class = $atts[ 'item_container_class' ]; … … 73 76 74 77 This section describes how to install the plugin and get it working. 75 76 e.g.77 78 78 1. Upload the plugin files to the `/wp-content/plugins/softmixt-relations` directory, or install the plugin through the WordPress plugins screen directly. 79 79 1. Activate the plugin through the 'Plugins' screen in WordPress … … 102 102 3. You can insert your connection into your post content by using the tinyMCE new button. 103 103 104 4. When you click on tinyMCE connections button you will bring up a new popup where you can set : "Container element", "Custom container class", "Item container element", " Custom class item", "Show post meta"104 4. When you click on tinyMCE connections button you will bring up a new popup where you can set : "Container element", "Custom container class", "Item container element", "Item container title element", "Custom class item", "Show post meta" 105 105 106 106 5. After tinyMCE modal submitted an a shortcode automatically created and inserted to WP Content. … … 110 110 == Changelog == 111 111 112 = 1.0 = 112 = 1.0.1 = 113 * SFT Relations widget added 114 * Custom container item title element added , now we can change post title element type if none set will be no element for title. 115 116 = 1.0.0 = 113 117 * First Stable Release 114 118 -
softmixt-relations/trunk/admin/assets/js/plugin-admin.js
r1689232 r1727679 157 157 { 158 158 $ ( post_to_connect + ' > [data-post-type="' + post_type + '"] ' ).show (); 159 160 159 } 161 160 … … 221 220 } 222 221 223 224 222 }) 225 223 ( jQuery ); -
softmixt-relations/trunk/admin/assets/tinymce/plugins/sftrelations/plugin.js
r1689232 r1727679 68 68 ] , 69 69 minWidth : 350 70 } , { 71 type : 'listbox' , 72 name : 'sft_item_title_element' , 73 label : 'Item container title element' , 74 values : [ 75 { text : 'None' , value : 'none' } , 76 { text : 'H1' , value : 'h1' } , 77 { text : 'H2' , value : 'h2' } , 78 { text : 'H3' , value : 'h3' } , 79 { text : 'H4' , value : 'h4' } , 80 { text : 'H5' , value : 'h5' } , 81 { text : 'H6' , value : 'h6' } , 82 { text : 'Paragraph' , value : 'p' } , 83 { text : 'Span' , value : 'span' } 84 ] , 85 minWidth : 350 70 86 } , 71 87 { … … 126 142 var container_class = e.data.sft_container_class ? 'container_class="' + e.data.sft_container_class + '" ' : ''; 127 143 var item_container = 'item_container="' + e.data.sft_item_container + '" '; 144 var item_title_container = 'item_title_container="' + e.data.sft_item_title_element + '" '; 128 145 var item_container_class = e.data.sft_item_container_class ? 'item_container_class="' + e.data.sft_item_container_class + '" ' : ''; 129 146 var item_show_title = e.data.sft_item_show_title === true ? 'item_show_title="' + e.data.sft_item_show_title + '" ' : ''; … … 138 155 container_class + 139 156 item_container + 157 item_title_container + 140 158 item_container_class + 141 159 item_show_title + -
softmixt-relations/trunk/admin/assets/tinymce/plugins/sftrelations/plugin.min.js
r1689232 r1727679 1 (function(){tinymce.create("tinymce.plugins.sftrelations",{init:function(a,b){a.addButton("sftrelations",{title:"SFT Relations",cmd:"sftrelations",image:b+"/sftrelations.png"});a.addCommand("sftrelations",function(){a.windowManager.open({title:"Add related posts",body:[{type:"listbox",name:"sft_container",label:"Container element",values:[{text:"Div",value:"div"},{text:"Ul",value:"ul"},{text:"Section",value:"section"},{text:"Article",value:"article"}],minWidth:350},{type:"textbox",name:"sft_container_class",label:"Custom container class",placeholder:"Custom container class ...",multiline:false,minWidth:700,minHeight:50},{type:"listbox",name:"sft_item_container",label:"Item container element",values:[{text:"Div",value:"div"},{text:"Span",value:"span"},{text:"Section",value:"section"},{text:"Article",value:"article"},{text:"P",value:"p"}],minWidth:350},{type:" textbox",name:"sft_item_container_class",label:"Custom item class",placeholder:"Custom container item class ...",multiline:false,minWidth:700,minHeight:50},{label:"Show post meta",type:"checkbox",name:"sft_item_show_title",text:"Show post title",checked:true},{label:" ",text:"Show post date",type:"checkbox",name:"sft_item_show_date",checked:true},{label:" ",text:"Show post author",type:"checkbox",name:"sft_item_show_author",checked:false},{label:" ",text:"Show post feature image",type:"checkbox",name:"sft_item_show_feature_image",checked:false},{label:" ",text:"Show post excerpt",type:"checkbox",name:"sft_item_show_excerpt",checked:false},{label:" ",text:"Show post content",type:"checkbox",name:"sft_item_show_content",checked:false}],onsubmit:function(k){var m='container="'+k.data.sft_container+'" ';var g=k.data.sft_container_class?'container_class="'+k.data.sft_container_class+'" ':"";var d='item_container="'+k.data.sft_item_container+'" ';var j=k.data.sft_item_container_class?'item_container_class="'+k.data.sft_item_container_class+'" ':"";var h=k.data.sft_item_show_title===true?'item_show_title="'+k.data.sft_item_show_title+'" ':"";var l=k.data.sft_item_show_date===true?'item_show_date="'+k.data.sft_item_show_date+'" ':"";var n=k.data.sft_item_show_author===true?'item_show_author="'+k.data.sft_item_show_author+'" ':"";var c=k.data.sft_item_show_feature_image===true?'item_show_feature_image="'+k.data.sft_item_show_feature_image+'" ':"";var f=k.data.sft_item_show_excerpt===true?'item_show_excerpt="'+k.data.sft_item_show_excerpt+'" ':"";var i=k.data.sft_item_show_content===true?'item_show_content="'+k.data.sft_item_show_content+'" ':"";a.insertContent("[sftrelations "+m+g+d+j+h+l+n+c+f+i+" ]")}})})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Add related posts.",author:"softmixt",authorurl:"http://softmixt.com",infourl:"http://softmixt.com/wordpress/plugins/softmixt-relations/",version:"0.1"}}});tinymce.PluginManager.add("sftrelations",tinymce.plugins.sftrelations)})();1 (function(){tinymce.create("tinymce.plugins.sftrelations",{init:function(a,b){a.addButton("sftrelations",{title:"SFT Relations",cmd:"sftrelations",image:b+"/sftrelations.png"});a.addCommand("sftrelations",function(){a.windowManager.open({title:"Add related posts",body:[{type:"listbox",name:"sft_container",label:"Container element",values:[{text:"Div",value:"div"},{text:"Ul",value:"ul"},{text:"Section",value:"section"},{text:"Article",value:"article"}],minWidth:350},{type:"textbox",name:"sft_container_class",label:"Custom container class",placeholder:"Custom container class ...",multiline:false,minWidth:700,minHeight:50},{type:"listbox",name:"sft_item_container",label:"Item container element",values:[{text:"Div",value:"div"},{text:"Span",value:"span"},{text:"Section",value:"section"},{text:"Article",value:"article"},{text:"P",value:"p"}],minWidth:350},{type:"listbox",name:"sft_item_title_element",label:"Item container title element",values:[{text:"None",value:"none"},{text:"H1",value:"h1"},{text:"H2",value:"h2"},{text:"H3",value:"h3"},{text:"H4",value:"h4"},{text:"H5",value:"h5"},{text:"H6",value:"h6"},{text:"Paragraph",value:"p"},{text:"Span",value:"span"}],minWidth:350},{type:"textbox",name:"sft_item_container_class",label:"Custom item class",placeholder:"Custom container item class ...",multiline:false,minWidth:700,minHeight:50},{label:"Show post meta",type:"checkbox",name:"sft_item_show_title",text:"Show post title",checked:true},{label:" ",text:"Show post date",type:"checkbox",name:"sft_item_show_date",checked:true},{label:" ",text:"Show post author",type:"checkbox",name:"sft_item_show_author",checked:false},{label:" ",text:"Show post feature image",type:"checkbox",name:"sft_item_show_feature_image",checked:false},{label:" ",text:"Show post excerpt",type:"checkbox",name:"sft_item_show_excerpt",checked:false},{label:" ",text:"Show post content",type:"checkbox",name:"sft_item_show_content",checked:false}],onsubmit:function(l){var n='container="'+l.data.sft_container+'" ';var h=l.data.sft_container_class?'container_class="'+l.data.sft_container_class+'" ':"";var d='item_container="'+l.data.sft_item_container+'" ';var f='item_title_container="'+l.data.sft_item_title_element+'" ';var k=l.data.sft_item_container_class?'item_container_class="'+l.data.sft_item_container_class+'" ':"";var i=l.data.sft_item_show_title===true?'item_show_title="'+l.data.sft_item_show_title+'" ':"";var m=l.data.sft_item_show_date===true?'item_show_date="'+l.data.sft_item_show_date+'" ':"";var o=l.data.sft_item_show_author===true?'item_show_author="'+l.data.sft_item_show_author+'" ':"";var c=l.data.sft_item_show_feature_image===true?'item_show_feature_image="'+l.data.sft_item_show_feature_image+'" ':"";var g=l.data.sft_item_show_excerpt===true?'item_show_excerpt="'+l.data.sft_item_show_excerpt+'" ':"";var j=l.data.sft_item_show_content===true?'item_show_content="'+l.data.sft_item_show_content+'" ':"";a.insertContent("[sftrelations "+n+h+d+f+k+i+m+o+c+g+j+" ]")}})})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Add related posts.",author:"softmixt",authorurl:"http://softmixt.com",infourl:"http://softmixt.com/wordpress/plugins/softmixt-relations/",version:"0.1"}}});tinymce.PluginManager.add("sftrelations",tinymce.plugins.sftrelations)})(); -
softmixt-relations/trunk/public/public.php
r1689232 r1727679 40 40 $atts = shortcode_atts ( 41 41 array ( 42 'post_id' => $post_id ,43 'container' => 'div' ,44 'container_class' => 'sft-rlp-container' ,45 'item_container' => 'div' ,46 'item_ container_class' => 'sft-rlp-itm-container' ,47 42 'post_id' => $post_id , 43 'container' => 'div' , 44 'container_class' => 'sft-rlp-container' , 45 'item_container' => 'div' , 46 'item_title_container' => 'none' , 47 'item_container_class' => 'sft-rlp-itm-container' , 48 48 'item_show_title' => 'true' , 49 49 'item_show_date' => 'true' , … … 60 60 $container_class = $atts[ 'container_class' ]; 61 61 $item_container = $atts[ 'item_container' ]; 62 $item_title_container = $atts[ 'item_title_container' ]; 62 63 $item_container_class = $atts[ 'item_container_class' ]; 63 64 $item_show_title = $atts[ 'item_show_title' ]; … … 80 81 if ( $item_show_title === 'true' ) 81 82 { 82 $title = get_the_title ( $post_related_id ); 83 $url = get_permalink ( $post_related_id ); 84 $itm_container .= "<h3 class=\"sft-rlp-title\"><a href=\"$url\">$title</a></h3>"; 83 $title = get_the_title ( $post_related_id ); 84 $url = get_permalink ( $post_related_id ); 85 86 if ( $item_title_container == 'none' ) 87 { 88 $itm_container .= "<a href=\"$url\">$title</a>"; 89 } 90 else 91 { 92 $itm_container .= "<$item_title_container class=\"sft-rlp-title\"><a href=\"$url\">$title</a></$item_title_container>"; 93 } 85 94 } 86 95 -
softmixt-relations/trunk/softmixt-relations.php
r1689254 r1727679 4 4 * Plugin URI: https://wordpress.org/plugins/softmixt-relations/ 5 5 * Description: Simple way for adding related posts . 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Softmixt 8 8 * Author URI: http://softmixt.com/ … … 77 77 require_once ( dirname ( __FILE__ ) . '/public/public.php' ); 78 78 79 // Include Default Widget 80 require ( dirname ( __FILE__ ) . '/widgets/default/SFT_DefaultWidget.php' ); 81 79 82 /**--------------------------------------------------------------------------------------------------------------------------------- 80 83 * RUN PLUGIN
Note: See TracChangeset
for help on using the changeset viewer.