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: 1204
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: 1204
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: 1204
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: 3087
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: 1204
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: 449
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: 1204
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: 1204
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: 3087
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: 1204
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: 3087
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: 1204
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: 1204
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