SOLVED - Issue with php Blog script

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

SOLVED - Issue with php Blog script

Post by Bluesman »

Hola amigos. Hope it's ok taking up this about a 3rd party script. I know that many WWB users install script from PHP jabbers, and so do I :D
I have a problem with their STIVA blog script. Can not insert pictures in the message area (2). But using the image tool (1) for the thumb and initial pic it works. Someone else had this issue? Any suggestions?

Image
Last edited by Bluesman on Fri Jul 15, 2022 6:12 pm, edited 1 time in total.
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Issue with php Blog script

Post by crispy68 »

Hey Bluesman,

The phpjabbers scripts only have a simple editor to start with. You can add additional features to the editor but you will need to add some code to one of the files by phpjabbers.

I've added a lot of extra capabilities to the editor (see below):

Image

Here is what you need to do:

1. Open up the folder for the script --> app --> web --> js --> FILE

The FILE depends on the script. For example, with the shopping cart you would open up: pjAdminProducts.js. For the blog, you will open up: pjAdminPosts.js. You can use notepad or you can do it right on your server using their editor.

2. Locate the "tinymce.init" function in the code. For the blog, it is at the top of the page. You will see code similar to below:

Code: Select all

tinymce.init({
		    selector: "textarea.selector-full-desc",
		    plugins: [
		        "advlist autolink lists link image charmap print preview anchor textcolor",
		        "searchreplace visualblocks code fullscreen hr",
		        "insertdatetime media table contextmenu paste fullpage colorpicker emoticons"
		    ],
		    //content_css: "app/web/css/ShoppingCart.css?" + new Date().getTime(),
		    width: 550,
		    height: 250,
		    toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
		    toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
		    toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
		    toolbar_items_size: "small",
		    fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",
		    setup: function (editor) {
		    	editor.on('change', function (e) {
		    		editor.editorManager.triggerSave();
		    		$(":input[name='" + editor.id + "']").valid();
		    	});
		    }
		});
	}
Most important part is the plugins

Code: Select all

plugins: [
		        "advlist autolink lists link image charmap print preview anchor textcolor",
		        "searchreplace visualblocks code fullscreen hr",
		        "insertdatetime media table contextmenu paste fullpage colorpicker emoticons"
		    ],
and toolbar and fontsize sections:

Code: Select all

  toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
		    toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
		    toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
		    toolbar_items_size: "small",
		    fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",
If you essentially copy what I have above it should give you an editor like mine above.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

Hi crispy68
That would be wonderful :D But I have the option both in menu and the button that I show in my pic to import pics?
Maybe something else is neaded :)

You have my contact on my webpage that is linked in the signature of my post... or I will also contact you through your webpage...
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Issue with php Blog script

Post by crispy68 »

The blog lets you insert 1 image as shown in your image. Adding the plugins and code I gave you will allow you to insert images and much more into the text itself.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Thu Jul 14, 2022 6:28 pm The blog lets you insert 1 image as shown in your image. Adding the plugins and code I gave you will allow you to insert images and much more into the text itself.
Ahh... Muchas Gracias amigo. Shall look through it amediately :D
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Thu Jul 14, 2022 6:28 pm The blog lets you insert 1 image as shown in your image. Adding the plugins and code I gave you will allow you to insert images and much more into the text itself.
Hi again crispy... I'm a little unsecure (not a coder) The beginning of the code looks like this (which part shall I change?):

var jQuery_1_8_2 = jQuery_1_8_2 || $.noConflict();
(function ($, undefined) {
if (window.tinyMCE !== undefined) {
tinymce.init({
relative_urls : false,
selector: "textarea#body",
theme: "modern",
browser_spellcheck : true,
contextmenu: false,
width: 600,
relative_urls: false,
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor"
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons",
image_advtab: true,
menubar: "file edit insert view table tools",
external_filemanager_path: "core/third-party/filemanager/",
filemanager_title: "Responsive Filemanager" ,
external_plugins: {"filemanager": "../../filemanager/plugin.min.js"}
});
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

My first part of the code with the parts you gave me incopied look like this now... but the editor looks the same as before??

Code: Select all

		tinymce.init({
		    selector: "textarea.selector-full-desc",
		    plugins: [
		        "advlist autolink lists link image charmap print preview anchor textcolor",
		        "searchreplace visualblocks code fullscreen hr",
		        "insertdatetime media table contextmenu paste fullpage colorpicker emoticons"
		    ],
		    //content_css: "app/web/css/ShoppingCart.css?" + new Date().getTime(),
		    width: 550,
		    height: 250,
		    toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
		    toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
		    toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
		    toolbar_items_size: "small",
		    fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",
		    setup: function (editor) {
		    	editor.on('change', function (e) {
		    		editor.editorManager.triggerSave();
		    		$(":input[name='" + editor.id + "']").valid();
		    	});
		    }
		});
	}
	$(function () {
The last row above I only have so you can see were the code ends...

Ok... nothing changed?? Maybe I shall copy the original from installation files again :?
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Issue with php Blog script

Post by crispy68 »

Hey Bluesman,

Sorry if i wasn't clear. You only want to add/change the sections below.

Look for this section

plugins: [
"advlist autolink lists link image charmap print preview anchor textcolor",
"searchreplace visualblocks code fullscreen hr",
"insertdatetime media table contextmenu paste fullpage colorpicker emoticons"
]
,

and add the above text to it. If there are other words there that aren't in my list above keep them. Just make sure that all of the above at least are present.

Then, you look for the toolbar section and type it like such along with adding the toolbar size and font formats:

toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
toolbar_items_size: "small",
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",


The rest of the code you leave. You are only adding/changing the above.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Thu Jul 14, 2022 10:33 pm Hey Bluesman,

Sorry if i wasn't clear. You only want to add/change the sections below.

Look for this section

plugins: [
"advlist autolink lists link image charmap print preview anchor textcolor",
"searchreplace visualblocks code fullscreen hr",
"insertdatetime media table contextmenu paste fullpage colorpicker emoticons"
]
,

and add the above text to it. If there are other words there that aren't in my list above keep them. Just make sure that all of the above at least are present.

Then, you look for the toolbar section and type it like such along with adding the toolbar size and font formats:

toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
toolbar_items_size: "small",
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",


The rest of the code you leave. You are only adding/changing the above.
Sorry crispy... I think I done exactly what you told...??? But nothing happends???
Can I send the original code to you... I paste the complete code of the js file here (for you to see:

Code: Select all

var jQuery_1_8_2 = jQuery_1_8_2 || $.noConflict();
(function ($, undefined) {
	if (window.tinyMCE !== undefined) {
		tinymce.init({
			relative_urls : false,
			selector: "textarea#body",
		    theme: "modern",
		    browser_spellcheck : true,
		    contextmenu: false,
		    width: 600,
		    relative_urls: false,
		    plugins: [
		         "advlist autolink link image lists charmap print preview hr anchor pagebreak",
		         "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
		         "save table contextmenu directionality emoticons template paste textcolor"
		    ],
		    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons",
		    image_advtab: true,
		    menubar: "file edit insert view table tools",
		    external_filemanager_path: "core/third-party/filemanager/",
		    filemanager_title: "Responsive Filemanager" ,
		    external_plugins: {"filemanager": "../../filemanager/plugin.min.js"}
		});
	}
	$(function () {
		var $frmCreatePost = $("#frmCreatePost"),
			$frmUpdatePost = $("#frmUpdatePost"),
			$frmExportPosts = $("#frmExportPosts"),
			datepicker = ($.fn.datepicker !== undefined),
			chosen = ($.fn.chosen !== undefined),
			validate = ($.fn.validate !== undefined),
			datagrid = ($.fn.datagrid !== undefined),
			dialog = ($.fn.dialog !== undefined),
			$dialogDelete = $("#dialogDeleteImage"),
			$dialogReset = $("#dialogReset"),
			tabs = ($.fn.tabs !== undefined),
			reseturl = null,
			$tabs = $("#tabs"),
			tOpt = {
				select: function (event, ui) {
					$(":input[name='tab_id']").val(ui.panel.id);
				}
			};
		if ($tabs.length > 0 && tabs) {
			$tabs.tabs(tOpt);
		}
		if (chosen) {
			$("#category_id").chosen();
			$("#author_id").chosen();
		}
		if ($frmCreatePost.length > 0 && validate) {
			$frmCreatePost.validate({
				messages:{
					"category_id": {
						required: myLabel.field_required
					},
					"title": {
						required: myLabel.field_required
					},
					"status": {
						required: myLabel.field_required
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em",
				ignore: ''
			});
		}
		if ($frmUpdatePost.length > 0 && validate) {
			$frmUpdatePost.validate({
				messages:{
					"category_id": {
						required: myLabel.field_required
					},
					"title": {
						required: myLabel.field_required
					},
					"status": {
						required: myLabel.field_required
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em", 
				ignore: ''
			});
			$(".post-rating").stars({
			    inputType: "select",
			    oneVoteOnly: true,
			    disabled: true,
			    callback: function(ui, type, value) {
			    	
			    }
			});
		}
		if ($frmExportPosts.length > 0 && validate) {
			$frmExportPosts.validate({
				rules: {
					"password": {
						required: function(){
							if($('#feed').is(':checked'))
							{
								return true;
							}else{
								return false;
							}
						}
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em",
				ignore: ".ignore"
			});
		}
		if ($("#grid").length > 0 && datagrid) {
			function formatComments(val, obj) {
				if(val == '0'){
					return val;
				}else{
					return '<a href="index.php?controller=pjAdminComments&action=pjActionIndex&post_id='+obj.id+'">'+val+'</a>';
				}
			}
			
			var $grid = $("#grid").datagrid({
				buttons: [{type: "edit", url: "index.php?controller=pjAdminPosts&action=pjActionUpdate&id={:id}"},
				          {type: "delete", url: "index.php?controller=pjAdminPosts&action=pjActionDeletePost&id={:id}"}
				          ],
				columns: [{text: myLabel.date_published, type: "text", sortable: true, editable: false, width: 110},
				          {text: myLabel.title, type: "text", sortable: true, editable: true, width: 300},
				          {text: myLabel.comments, type: "text", sortable: true, editable: false, width: 90, renderer: formatComments},
				          {text: myLabel.status, type: "select", sortable: true, editable: true, options: [
				                                                                                     {label: myLabel.active, value: "T"}, 
				                                                                                     {label: myLabel.inactive, value: "F"}
				                                                                                     ], applyClass: "pj-status"}],
				dataUrl: "index.php?controller=pjAdminPosts&action=pjActionGetPost" + pjGrid.queryString,
				dataType: "json",
				fields: ['published_date', 'title', 'cnt_comments', 'status'],
				paginator: {
					actions: [
					   {text: myLabel.delete_selected, url: "index.php?controller=pjAdminPosts&action=pjActionDeletePostBulk", render: true, confirmation: myLabel.delete_confirmation},
					   {text: myLabel.revert_status, url: "index.php?controller=pjAdminPosts&action=pjActionStatusPost", render: true},
					   {text: myLabel.exported, url: "index.php?controller=pjAdminPosts&action=pjActionExportPost", ajax: false}
					],
					gotoPage: true,
					paginate: true,
					total: true,
					rowCount: true
				},
				saveUrl: "index.php?controller=pjAdminPosts&action=pjActionSavePost&id={:id}",
				select: {
					field: "id",
					name: "record[]"
				}
			});
		}
		
		$(document).on("click", ".btn-all", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$(this).addClass("pj-button-active").siblings(".pj-button").removeClass("pj-button-active");
			var content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			$.extend(cache, {
				status: "",
				q: "",
				title: "",
				blog_text: "",
				author_id: "",
				date_from: "",
				date_to: ""
			});
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("click", ".btn-filter", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var $this = $(this),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache"),
				obj = {};
			$this.addClass("pj-button-active").siblings(".pj-button").removeClass("pj-button-active");
			obj.status = "";
			obj[$this.data("column")] = $this.data("value");
			$.extend(cache, obj);
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("submit", ".frm-filter", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var $this = $(this),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			$.extend(cache, {
				q: $this.find("input[name='q']").val(),
				title: "",
				blog_text: "",
				author_id: "",
				date_from: "",
				date_to: ""
			});
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("click", ".pj-button-detailed, .pj-button-detailed-arrow", function (e) {
			e.stopPropagation();
			$(".pj-form-filter-advanced").toggle();
		}).on("submit", ".frm-filter-advanced", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var obj = {},
				$this = $(this),
				arr = $this.serializeArray(),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			for (var i = 0, iCnt = arr.length; i < iCnt; i++) {
				obj[arr[i].name] = arr[i].value;
			}
			$.extend(cache, obj);
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("reset", ".frm-filter-advanced", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$(".pj-button-detailed").trigger("click");
			$('#title').val('');
			$('#blog_text').val('');
			$('#author_id').val('');
			$('input[name="date_from"]').val('');
			$('input[name="date_to"]').val('');
		}).on("focusin", ".datepicker", function (e) {
			var minDate, maxDate,
				$this = $(this),
				custom = {},
				o = {
					firstDay: $this.attr("rel"),
					dateFormat: $this.attr("rev")
				};
			switch ($this.attr("name")) {
			case "date_from":
				if($(".datepicker[name='date_to']").val() != '')
				{
					maxDate = $(".datepicker[name='date_to']").datepicker({
						firstDay: $this.attr("rel"),
						dateFormat: $this.attr("rev")
					}).datepicker("getDate");
					$(".datepicker[name='date_to']").datepicker("destroy").removeAttr("id");
					if (maxDate !== null) {
						custom.maxDate = maxDate;
					}
				}
				break;
			case "date_to":
				if($(".datepicker[name='date_from']").val() != '')
				{
					minDate = $(".datepicker[name='date_from']").datepicker({
						firstDay: $this.attr("rel"),
						dateFormat: $this.attr("rev")
					}).datepicker("getDate");
					$(".datepicker[name='date_from']").datepicker("destroy").removeAttr("id");
					if (minDate !== null) {
						custom.minDate = minDate;
					}
				}
				break;
			}
			$(this).datepicker($.extend(o, custom));
			
		}).on("focusin", ".datepick", function (e) {
			var $this = $(this);
			$this.datepicker({
				firstDay: $this.attr("rel"),
				dateFormat: $this.attr("rev")
			});
		}).on("click", ".pj-form-field-icon-date", function (e) {
			var $dp = $(this).parent().siblings("input[type='text']");
			if ($dp.hasClass("hasDatepicker")) {
				$dp.datepicker("show");
			} else {
				$dp.trigger("focusin").datepicker("show");
			}
		}).on("click", "#rating_reset", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			reseturl = $(this).attr('href');
			$dialogReset.dialog("open");
		}).on("click", ".delete-image", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$('#delete_url').text($(this).attr('href'));
			$dialogDelete.dialog("open");
		}).on("click", "#file", function (e) {
			$('#tsSubmitButton').val(myLabel.btn_export);
			$('.tsFeedContainer').hide();
			$('.tsPassowrdContainer').hide();
		}).on("click", "#feed", function (e) {
			$('.tsPassowrdContainer').show();
			$('#tsSubmitButton').val(myLabel.btn_get_url);
		}).on("focus", "#posts_feed", function (e) {
			$(this).select();
		});
		
		if ($dialogReset.length > 0 && dialog) {
			$dialogReset.dialog({
				modal: true,
				autoOpen: false,
				resizable: false,
				draggable: false,
				width: 400,
				buttons: {
					"Reset": function () {
						$(this).dialog("close");
						window.location.href = reseturl;
					},
					"Cancel": function () {
						$(this).dialog("close");
					}
				}
			});
		}
		if ($dialogDelete.length > 0 && dialog) {
			$dialogDelete.dialog({
				modal: true,
				autoOpen: false,
				resizable: false,
				draggable: false,
				width: 400,
				buttons: {
					"Delete": function () {
						$.ajax({
							type: "GET",
							dataType: "json",
							url: $('#delete_url').text(),
							success: function (res) {
								if(res.code == 200){
									$('#image_container').remove();
									$dialogDelete.dialog('close');
								}
							}
						});
					},
					"Cancel": function () {
						$(this).dialog("close");
					}
				}
			});
		}
	});
})(jQuery_1_8_2);
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Issue with php Blog script

Post by crispy68 »

I don't see the change for the toolbar section in your code.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Fri Jul 15, 2022 12:18 am I don't see the change for the toolbar section in your code.
Hi crispy... sorry for the misunderstandings. As I wrote above this is the original code, so you can see how it looks. I cannot figure out exactly what to change in the sections because it doesnt look exactly as you describes. And I was pretty sure that I have tested some options that should work, but not.
Thats why I sent this. Above you inserted a code from the shop and that was different so I got unsure about what to do :?
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Fri Jul 15, 2022 12:18 am I don't see the change for the toolbar section in your code.
Sorry to disturb you crispy... I'm greatful for your effort to help me, seams I doesn't get it... Have tryed several times again and the only change I get in some attempt is that the editor disappear totally and I only get a textfield named body??
Now I have returned to the original file.
"Make My Day"

See my Website
alan_sh
 
 
Posts: 1681
Joined: Tue Jan 01, 2019 5:50 pm

Re: Issue with php Blog script

Post by alan_sh »

Why not just buy/use Crispy68''s extension?
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

alan_sh wrote: Fri Jul 15, 2022 9:12 am Why not just buy/use Crispy68''s extension?
Hi Alan... I have the extension from php jabbers, the developer version, so I can make changes to it. I think crispy were using the "STIVA shop" version as example, and they seams to differ in the code...
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Issue with php Blog script

Post by crispy68 »

Hey Bluesman,

So the actual code for the script can vary from script to script the "tinyMCe" section is usually about the same. The focus is not on the entire script but only the sections I outlined above: plugins, toolbar and fontsize formats. The rest of the code is not important.

So I took the code you provided and added the changes:

Code: Select all

var jQuery_1_8_2 = jQuery_1_8_2 || $.noConflict();
(function ($, undefined) {
	if (window.tinyMCE !== undefined) {
		tinymce.init({
			relative_urls : false,
			selector: "textarea#body",
		    theme: "modern",
		    browser_spellcheck : true,
		    contextmenu: false,
		    width: 600,
		    relative_urls: false,
		    plugins: [
		         "advlist autolink link image lists charmap print preview hr anchor pagebreak",
		         "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
		         "save table contextmenu directionality emoticons template paste textcolor"
		    ],
		    toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
		    toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
		    toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
		    toolbar_items_size: "small",
		    fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",
		    image_advtab: true,
		    menubar: "file edit insert view table tools",
		    external_filemanager_path: "core/third-party/filemanager/",
		    filemanager_title: "Responsive Filemanager" ,
		    external_plugins: {"filemanager": "../../filemanager/plugin.min.js"}
		});
	}
	$(function () {
		var $frmCreatePost = $("#frmCreatePost"),
			$frmUpdatePost = $("#frmUpdatePost"),
			$frmExportPosts = $("#frmExportPosts"),
			datepicker = ($.fn.datepicker !== undefined),
			chosen = ($.fn.chosen !== undefined),
			validate = ($.fn.validate !== undefined),
			datagrid = ($.fn.datagrid !== undefined),
			dialog = ($.fn.dialog !== undefined),
			$dialogDelete = $("#dialogDeleteImage"),
			$dialogReset = $("#dialogReset"),
			tabs = ($.fn.tabs !== undefined),
			reseturl = null,
			$tabs = $("#tabs"),
			tOpt = {
				select: function (event, ui) {
					$(":input[name='tab_id']").val(ui.panel.id);
				}
			};
		if ($tabs.length > 0 && tabs) {
			$tabs.tabs(tOpt);
		}
		if (chosen) {
			$("#category_id").chosen();
			$("#author_id").chosen();
		}
		if ($frmCreatePost.length > 0 && validate) {
			$frmCreatePost.validate({
				messages:{
					"category_id": {
						required: myLabel.field_required
					},
					"title": {
						required: myLabel.field_required
					},
					"status": {
						required: myLabel.field_required
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em",
				ignore: ''
			});
		}
		if ($frmUpdatePost.length > 0 && validate) {
			$frmUpdatePost.validate({
				messages:{
					"category_id": {
						required: myLabel.field_required
					},
					"title": {
						required: myLabel.field_required
					},
					"status": {
						required: myLabel.field_required
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em", 
				ignore: ''
			});
			$(".post-rating").stars({
			    inputType: "select",
			    oneVoteOnly: true,
			    disabled: true,
			    callback: function(ui, type, value) {
			    	
			    }
			});
		}
		if ($frmExportPosts.length > 0 && validate) {
			$frmExportPosts.validate({
				rules: {
					"password": {
						required: function(){
							if($('#feed').is(':checked'))
							{
								return true;
							}else{
								return false;
							}
						}
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em",
				ignore: ".ignore"
			});
		}
		if ($("#grid").length > 0 && datagrid) {
			function formatComments(val, obj) {
				if(val == '0'){
					return val;
				}else{
					return '<a href="index.php?controller=pjAdminComments&action=pjActionIndex&post_id='+obj.id+'">'+val+'</a>';
				}
			}
			
			var $grid = $("#grid").datagrid({
				buttons: [{type: "edit", url: "index.php?controller=pjAdminPosts&action=pjActionUpdate&id={:id}"},
				          {type: "delete", url: "index.php?controller=pjAdminPosts&action=pjActionDeletePost&id={:id}"}
				          ],
				columns: [{text: myLabel.date_published, type: "text", sortable: true, editable: false, width: 110},
				          {text: myLabel.title, type: "text", sortable: true, editable: true, width: 300},
				          {text: myLabel.comments, type: "text", sortable: true, editable: false, width: 90, renderer: formatComments},
				          {text: myLabel.status, type: "select", sortable: true, editable: true, options: [
				                                                                                     {label: myLabel.active, value: "T"}, 
				                                                                                     {label: myLabel.inactive, value: "F"}
				                                                                                     ], applyClass: "pj-status"}],
				dataUrl: "index.php?controller=pjAdminPosts&action=pjActionGetPost" + pjGrid.queryString,
				dataType: "json",
				fields: ['published_date', 'title', 'cnt_comments', 'status'],
				paginator: {
					actions: [
					   {text: myLabel.delete_selected, url: "index.php?controller=pjAdminPosts&action=pjActionDeletePostBulk", render: true, confirmation: myLabel.delete_confirmation},
					   {text: myLabel.revert_status, url: "index.php?controller=pjAdminPosts&action=pjActionStatusPost", render: true},
					   {text: myLabel.exported, url: "index.php?controller=pjAdminPosts&action=pjActionExportPost", ajax: false}
					],
					gotoPage: true,
					paginate: true,
					total: true,
					rowCount: true
				},
				saveUrl: "index.php?controller=pjAdminPosts&action=pjActionSavePost&id={:id}",
				select: {
					field: "id",
					name: "record[]"
				}
			});
		}
		
		$(document).on("click", ".btn-all", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$(this).addClass("pj-button-active").siblings(".pj-button").removeClass("pj-button-active");
			var content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			$.extend(cache, {
				status: "",
				q: "",
				title: "",
				blog_text: "",
				author_id: "",
				date_from: "",
				date_to: ""
			});
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("click", ".btn-filter", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var $this = $(this),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache"),
				obj = {};
			$this.addClass("pj-button-active").siblings(".pj-button").removeClass("pj-button-active");
			obj.status = "";
			obj[$this.data("column")] = $this.data("value");
			$.extend(cache, obj);
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("submit", ".frm-filter", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var $this = $(this),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			$.extend(cache, {
				q: $this.find("input[name='q']").val(),
				title: "",
				blog_text: "",
				author_id: "",
				date_from: "",
				date_to: ""
			});
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("click", ".pj-button-detailed, .pj-button-detailed-arrow", function (e) {
			e.stopPropagation();
			$(".pj-form-filter-advanced").toggle();
		}).on("submit", ".frm-filter-advanced", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var obj = {},
				$this = $(this),
				arr = $this.serializeArray(),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			for (var i = 0, iCnt = arr.length; i < iCnt; i++) {
				obj[arr[i].name] = arr[i].value;
			}
			$.extend(cache, obj);
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("reset", ".frm-filter-advanced", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$(".pj-button-detailed").trigger("click");
			$('#title').val('');
			$('#blog_text').val('');
			$('#author_id').val('');
			$('input[name="date_from"]').val('');
			$('input[name="date_to"]').val('');
		}).on("focusin", ".datepicker", function (e) {
			var minDate, maxDate,
				$this = $(this),
				custom = {},
				o = {
					firstDay: $this.attr("rel"),
					dateFormat: $this.attr("rev")
				};
			switch ($this.attr("name")) {
			case "date_from":
				if($(".datepicker[name='date_to']").val() != '')
				{
					maxDate = $(".datepicker[name='date_to']").datepicker({
						firstDay: $this.attr("rel"),
						dateFormat: $this.attr("rev")
					}).datepicker("getDate");
					$(".datepicker[name='date_to']").datepicker("destroy").removeAttr("id");
					if (maxDate !== null) {
						custom.maxDate = maxDate;
					}
				}
				break;
			case "date_to":
				if($(".datepicker[name='date_from']").val() != '')
				{
					minDate = $(".datepicker[name='date_from']").datepicker({
						firstDay: $this.attr("rel"),
						dateFormat: $this.attr("rev")
					}).datepicker("getDate");
					$(".datepicker[name='date_from']").datepicker("destroy").removeAttr("id");
					if (minDate !== null) {
						custom.minDate = minDate;
					}
				}
				break;
			}
			$(this).datepicker($.extend(o, custom));
			
		}).on("focusin", ".datepick", function (e) {
			var $this = $(this);
			$this.datepicker({
				firstDay: $this.attr("rel"),
				dateFormat: $this.attr("rev")
			});
		}).on("click", ".pj-form-field-icon-date", function (e) {
			var $dp = $(this).parent().siblings("input[type='text']");
			if ($dp.hasClass("hasDatepicker")) {
				$dp.datepicker("show");
			} else {
				$dp.trigger("focusin").datepicker("show");
			}
		}).on("click", "#rating_reset", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			reseturl = $(this).attr('href');
			$dialogReset.dialog("open");
		}).on("click", ".delete-image", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$('#delete_url').text($(this).attr('href'));
			$dialogDelete.dialog("open");
		}).on("click", "#file", function (e) {
			$('#tsSubmitButton').val(myLabel.btn_export);
			$('.tsFeedContainer').hide();
			$('.tsPassowrdContainer').hide();
		}).on("click", "#feed", function (e) {
			$('.tsPassowrdContainer').show();
			$('#tsSubmitButton').val(myLabel.btn_get_url);
		}).on("focus", "#posts_feed", function (e) {
			$(this).select();
		});
		
		if ($dialogReset.length > 0 && dialog) {
			$dialogReset.dialog({
				modal: true,
				autoOpen: false,
				resizable: false,
				draggable: false,
				width: 400,
				buttons: {
					"Reset": function () {
						$(this).dialog("close");
						window.location.href = reseturl;
					},
					"Cancel": function () {
						$(this).dialog("close");
					}
				}
			});
		}
		if ($dialogDelete.length > 0 && dialog) {
			$dialogDelete.dialog({
				modal: true,
				autoOpen: false,
				resizable: false,
				draggable: false,
				width: 400,
				buttons: {
					"Delete": function () {
						$.ajax({
							type: "GET",
							dataType: "json",
							url: $('#delete_url').text(),
							success: function (res) {
								if(res.code == 200){
									$('#image_container').remove();
									$dialogDelete.dialog('close');
								}
							}
						});
					},
					"Cancel": function () {
						$(this).dialog("close");
					}
				}
			});
		}
	});
})(jQuery_1_8_2);
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

:D
crispy68 wrote: Fri Jul 15, 2022 2:03 pm Hey Bluesman,

So the actual code for the script can vary from script to script the "tinyMCe" section is usually about the same. The focus is not on the entire script but only the sections I outlined above: plugins, toolbar and fontsize formats. The rest of the code is not important.

So I took the code you provided and added the changes:

:D Thankyou very much crispy. I will test it amediately. Very kind of you. I was some confused (Am not a coder) but I use to manage this things :roll:
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Fri Jul 15, 2022 2:03 pm Hey Bluesman,

So the actual code for the script can vary from script to script the "tinyMCe" section is usually about the same. The focus is not on the entire script but only the sections I outlined above: plugins, toolbar and fontsize formats. The rest of the code is not important.

So I took the code you provided and added the changes:

Hi crispu... that did the trick so I have your full menu as you showed :D But unfortunately I still can not implement images in the editor area/design area? I have set all filepermissions for the whole account to "7777"Get this:

Image
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

Get this error message:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access this resource.</p> </body></html>
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Issue with php Blog script

Post by crispy68 »

I'm not familiar with that error. When do you get that error? Looks like a permissions error to me but not sure.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Fri Jul 15, 2022 6:03 pm I'm not familiar with that error. When do you get that error? Looks like a permissions error to me but not sure.
Solved! I had a longgoing conversation with my host provider... they at last come up with a solution:
"The issue was caused from a ModSecurity rule which I have whitelisted for you, now everything is working as intended."

I have asked them were to find and how to fix this myself.
"Make My Day"

See my Website
User avatar
onlye
 
 
Posts: 366
Joined: Sun Jun 17, 2018 12:36 am
Location: Gluckstadt, MS USA
Contact:

Re: SOLVED - Issue with php Blog script

Post by onlye »

Bluesman - did you get the new version installed? All working OK now?
onlye
Gluckstadt, MS USA
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: SOLVED - Issue with php Blog script

Post by Bluesman »

onlye wrote: Fri Jul 15, 2022 11:58 pm Bluesman - did you get the new version installed? All working OK now?
Yes the one I got from crispy... tnx. The import of images in the body/design area works fine now. The import of videos still lacks. Having conversation with my hosting company :)
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Fri Jul 15, 2022 2:03 pm Hey Bluesman,

So the actual code for the script can vary from script to script the "tinyMCe" section is usually about the same. The focus is not on the entire script but only the sections I outlined above: plugins, toolbar and fontsize formats. The rest of the code is not important.

So I took the code you provided and added the changes:
Hi again crispy... I hate to disturb you with the same issue again :cry: but I have installed the same php jabbers STIVA blogscript to another site. I thought it was as simple as just copy the "pjAdminPosts.js" from the other installation and change in this new project... but of cause it's not that easy :roll: I tried and then I lost the whole editor. So there must be some specific lines that correspods to the site produced during the installation?
Can I please begh you to change the lines you did the last time in this code. Maybe if you can make a text doc to, where you highlight the lines that you change... I ow you 2 cups of coffee 8)

Code: Select all

var jQuery_1_8_2 = jQuery_1_8_2 || $.noConflict();
(function ($, undefined) {
	if (window.tinyMCE !== undefined) {
		tinymce.init({
			relative_urls : false,
			selector: "textarea#body",
		    theme: "modern",
		    browser_spellcheck : true,
		    contextmenu: false,
		    width: 600,
		    relative_urls: false,
		    plugins: [
		         "advlist autolink link image lists charmap print preview hr anchor pagebreak",
		         "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
		         "save table contextmenu directionality emoticons template paste textcolor"
		    ],
		    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons",
		    image_advtab: true,
		    menubar: "file edit insert view table tools"
		});
	}
	$(function () {
		var $frmCreatePost = $("#frmCreatePost"),
			$frmUpdatePost = $("#frmUpdatePost"),
			$frmExportPosts = $("#frmExportPosts"),
			datepicker = ($.fn.datepicker !== undefined),
			chosen = ($.fn.chosen !== undefined),
			validate = ($.fn.validate !== undefined),
			datagrid = ($.fn.datagrid !== undefined),
			dialog = ($.fn.dialog !== undefined),
			$dialogDelete = $("#dialogDeleteImage"),
			$dialogReset = $("#dialogReset"),
			tabs = ($.fn.tabs !== undefined),
			reseturl = null,
			$tabs = $("#tabs"),
			tOpt = {
				select: function (event, ui) {
					$(":input[name='tab_id']").val(ui.panel.id);
				}
			};
		if ($tabs.length > 0 && tabs) {
			$tabs.tabs(tOpt);
		}
		if (chosen) {
			$("#category_id").chosen();
			$("#author_id").chosen();
		}
		if ($frmCreatePost.length > 0 && validate) {
			$frmCreatePost.validate({
				messages:{
					"category_id": {
						required: myLabel.field_required
					},
					"title": {
						required: myLabel.field_required
					},
					"status": {
						required: myLabel.field_required
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em",
				ignore: ''
			});
		}
		if ($frmUpdatePost.length > 0 && validate) {
			$frmUpdatePost.validate({
				messages:{
					"category_id": {
						required: myLabel.field_required
					},
					"title": {
						required: myLabel.field_required
					},
					"status": {
						required: myLabel.field_required
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em", 
				ignore: ''
			});
			$(".post-rating").stars({
			    inputType: "select",
			    oneVoteOnly: true,
			    disabled: true,
			    callback: function(ui, type, value) {
			    	
			    }
			});
		}
		if ($frmExportPosts.length > 0 && validate) {
			$frmExportPosts.validate({
				rules: {
					"password": {
						required: function(){
							if($('#feed').is(':checked'))
							{
								return true;
							}else{
								return false;
							}
						}
					}
				},
				errorPlacement: function (error, element) {
					error.insertAfter(element.parent());
				},
				onkeyup: false,
				errorClass: "err",
				wrapper: "em",
				ignore: ".ignore"
			});
		}
		if ($("#grid").length > 0 && datagrid) {
			function formatComments(val, obj) {
				if(val == '0'){
					return val;
				}else{
					return '<a href="index.php?controller=pjAdminComments&action=pjActionIndex&post_id='+obj.id+'">'+val+'</a>';
				}
			}
			
			var $grid = $("#grid").datagrid({
				buttons: [{type: "edit", url: "index.php?controller=pjAdminPosts&action=pjActionUpdate&id={:id}"},
				          {type: "delete", url: "index.php?controller=pjAdminPosts&action=pjActionDeletePost&id={:id}"}
				          ],
				columns: [{text: myLabel.date_published, type: "text", sortable: true, editable: false, width: 110},
				          {text: myLabel.title, type: "text", sortable: true, editable: true, width: 300},
				          {text: myLabel.comments, type: "text", sortable: true, editable: false, width: 90, renderer: formatComments},
				          {text: myLabel.status, type: "select", sortable: true, editable: true, options: [
				                                                                                     {label: myLabel.active, value: "T"}, 
				                                                                                     {label: myLabel.inactive, value: "F"}
				                                                                                     ], applyClass: "pj-status"}],
				dataUrl: "index.php?controller=pjAdminPosts&action=pjActionGetPost" + pjGrid.queryString,
				dataType: "json",
				fields: ['published_date', 'title', 'cnt_comments', 'status'],
				paginator: {
					actions: [
					   {text: myLabel.delete_selected, url: "index.php?controller=pjAdminPosts&action=pjActionDeletePostBulk", render: true, confirmation: myLabel.delete_confirmation},
					   {text: myLabel.revert_status, url: "index.php?controller=pjAdminPosts&action=pjActionStatusPost", render: true},
					   {text: myLabel.exported, url: "index.php?controller=pjAdminPosts&action=pjActionExportPost", ajax: false}
					],
					gotoPage: true,
					paginate: true,
					total: true,
					rowCount: true
				},
				saveUrl: "index.php?controller=pjAdminPosts&action=pjActionSavePost&id={:id}",
				select: {
					field: "id",
					name: "record[]"
				}
			});
		}
		
		$(document).on("click", ".btn-all", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$(this).addClass("pj-button-active").siblings(".pj-button").removeClass("pj-button-active");
			var content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			$.extend(cache, {
				status: "",
				q: "",
				title: "",
				blog_text: "",
				author_id: "",
				date_from: "",
				date_to: ""
			});
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("click", ".btn-filter", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var $this = $(this),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache"),
				obj = {};
			$this.addClass("pj-button-active").siblings(".pj-button").removeClass("pj-button-active");
			obj.status = "";
			obj[$this.data("column")] = $this.data("value");
			$.extend(cache, obj);
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("submit", ".frm-filter", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var $this = $(this),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			$.extend(cache, {
				q: $this.find("input[name='q']").val(),
				title: "",
				blog_text: "",
				author_id: "",
				date_from: "",
				date_to: ""
			});
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("click", ".pj-button-detailed, .pj-button-detailed-arrow", function (e) {
			e.stopPropagation();
			$(".pj-form-filter-advanced").toggle();
		}).on("submit", ".frm-filter-advanced", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			var obj = {},
				$this = $(this),
				arr = $this.serializeArray(),
				content = $grid.datagrid("option", "content"),
				cache = $grid.datagrid("option", "cache");
			for (var i = 0, iCnt = arr.length; i < iCnt; i++) {
				obj[arr[i].name] = arr[i].value;
			}
			$.extend(cache, obj);
			$grid.datagrid("option", "cache", cache);
			$grid.datagrid("load", "index.php?controller=pjAdminPosts&action=pjActionGetPost", "published_date", "DESC", content.page, content.rowCount);
			return false;
		}).on("reset", ".frm-filter-advanced", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$(".pj-button-detailed").trigger("click");
			$('#title').val('');
			$('#blog_text').val('');
			$('#author_id').val('');
			$('input[name="date_from"]').val('');
			$('input[name="date_to"]').val('');
		}).on("focusin", ".datepicker", function (e) {
			var minDate, maxDate,
				$this = $(this),
				custom = {},
				o = {
					firstDay: $this.attr("rel"),
					dateFormat: $this.attr("rev")
				};
			switch ($this.attr("name")) {
			case "date_from":
				if($(".datepicker[name='date_to']").val() != '')
				{
					maxDate = $(".datepicker[name='date_to']").datepicker({
						firstDay: $this.attr("rel"),
						dateFormat: $this.attr("rev")
					}).datepicker("getDate");
					$(".datepicker[name='date_to']").datepicker("destroy").removeAttr("id");
					if (maxDate !== null) {
						custom.maxDate = maxDate;
					}
				}
				break;
			case "date_to":
				if($(".datepicker[name='date_from']").val() != '')
				{
					minDate = $(".datepicker[name='date_from']").datepicker({
						firstDay: $this.attr("rel"),
						dateFormat: $this.attr("rev")
					}).datepicker("getDate");
					$(".datepicker[name='date_from']").datepicker("destroy").removeAttr("id");
					if (minDate !== null) {
						custom.minDate = minDate;
					}
				}
				break;
			}
			$(this).datepicker($.extend(o, custom));
			
		}).on("focusin", ".datepick", function (e) {
			var $this = $(this);
			$this.datepicker({
				firstDay: $this.attr("rel"),
				dateFormat: $this.attr("rev")
			});
		}).on("click", ".pj-form-field-icon-date", function (e) {
			var $dp = $(this).parent().siblings("input[type='text']");
			if ($dp.hasClass("hasDatepicker")) {
				$dp.datepicker("show");
			} else {
				$dp.trigger("focusin").datepicker("show");
			}
		}).on("click", "#rating_reset", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			reseturl = $(this).attr('href');
			$dialogReset.dialog("open");
		}).on("click", ".delete-image", function (e) {
			if (e && e.preventDefault) {
				e.preventDefault();
			}
			$('#delete_url').text($(this).attr('href'));
			$dialogDelete.dialog("open");
		}).on("click", "#file", function (e) {
			$('#tsSubmitButton').val(myLabel.btn_export);
			$('.tsFeedContainer').hide();
			$('.tsPassowrdContainer').hide();
		}).on("click", "#feed", function (e) {
			$('.tsPassowrdContainer').show();
			$('#tsSubmitButton').val(myLabel.btn_get_url);
		}).on("focus", "#posts_feed", function (e) {
			$(this).select();
		});
		
		if ($dialogReset.length > 0 && dialog) {
			$dialogReset.dialog({
				modal: true,
				autoOpen: false,
				resizable: false,
				draggable: false,
				width: 400,
				buttons: {
					"Reset": function () {
						$(this).dialog("close");
						window.location.href = reseturl;
					},
					"Cancel": function () {
						$(this).dialog("close");
					}
				}
			});
		}
		if ($dialogDelete.length > 0 && dialog) {
			$dialogDelete.dialog({
				modal: true,
				autoOpen: false,
				resizable: false,
				draggable: false,
				width: 400,
				buttons: {
					"Delete": function () {
						$.ajax({
							type: "GET",
							dataType: "json",
							url: $('#delete_url').text(),
							success: function (res) {
								if(res.code == 200){
									$('#image_container').remove();
									$dialogDelete.dialog('close');
								}
							}
						});
					},
					"Cancel": function () {
						$(this).dialog("close");
					}
				}
			});
		}
	});
})(jQuery_1_8_2);
Having tryed several hours with your last solutions in the post and trying to cut and past just the parts you mention from the working js file to the new one... doesn't work either. Just get a empty editor space, changing back to original now :?
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: SOLVED - Issue with php Blog script

Post by crispy68 »

@Bluesman,

I assume the code above is the original code.

In the code above, locate the section starting with:

toolbar: "insertfile undo redo......etc.

and insert the following in place of:

Code: Select all

toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
toolbar_items_size: "small",
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",
As for the plugins section, it looks like everything is there that is needed so no changes need to be made. Keep in mind with any code, the slightest missing comma, semicolon, parenthesis, or bracket can make everything not work.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: SOLVED - Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Tue Aug 30, 2022 5:35 pm @Bluesman,

I assume the code above is the original code.

In the code above, locate the section starting with:

toolbar: "insertfile undo redo......etc.

and insert the following in place of:

Code: Select all

toolbar1: "fullpage | print preview searchreplace | undo redo | visualblocks fullscreen | cut copy paste | table | bullist numlist | outdent indent blockquote",
toolbar2: "styleselect | formatselect | fontselect | fontsizeselect | bold italic underline | forecolor backcolor",
toolbar3: "alignleft aligncenter alignright alignjustify | hr | charmap emoticons | link unlink anchor image media code insertdatetime | subscript superscript",
toolbar_items_size: "small",
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 28pt 32pt 36pt 38pt 40pt 42pt 46pt 48pt 56pt 64pt",
As for the plugins section, it looks like everything is there that is needed so no changes need to be made. Keep in mind with any code, the slightest missing comma, semicolon, parenthesis, or bracket can make everything not work.
Hi crispy... and thanks a lot for your help. Did exactly as you instructe :D Get the more advanced toolbar, but not the function for upload imgs and videos from your local disc.
This works in the other script you provided.

After your code is attached:
Image
"Make My Day"

See my Website
User avatar
crispy68
 
 
Posts: 2737
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: SOLVED - Issue with php Blog script

Post by crispy68 »

The ability to upload images I believe is based on whether the script has that functionality built in rather than just the editor. If memory serves me, I believe this functionality had to be added by phpjabbers to be able to do that.
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: SOLVED - Issue with php Blog script

Post by Bluesman »

crispy68 wrote: Tue Aug 30, 2022 9:26 pm The ability to upload images I believe is based on whether the script has that functionality built in rather than just the editor. If memory serves me, I believe this functionality had to be added by phpjabbers to be able to do that.
Strange... the other blogscript you helped me with has the future...
Image

Can it be serverside? That they block some futures?
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1116
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: SOLVED - Issue with php Blog script

Post by Bluesman »

OK... solved again. Had to use my head :shock: Strange that it didnt upload this plugin as it is in the script from beginning. Maybe the filerights stoped it?!
But now I have copied the plugin from the other installed script and it works. in: /core/third-party/filemanager

:D
"Make My Day"

See my Website
Post Reply