Pro_News version 3.2: Lots of Improvement

Forum dedicated to discussion of articles posted in Home page of Pro_News
Reply to topicReply to topic
Go to page  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next 

  
23 Jun '09 Tue Jun 23, 2009 16:14    
masino_sinaga
Developer  Developer
  •  

Post Pro_News version 3.2: Lots of Improvement

Click to follow Link to Original Article.



masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
23 Jun '09 Tue Jun 23, 2009 16:43    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

Thanks for the info. Looking forward to it.

Not sure that I understand all of these yet, but will do when I get the code Wink

Pagination in Admin was certainly going to be needed soon, I'd just never got around to it.

Need to think about Forum by Category (vs just Section)... I don't want to increase the db i/o if at all possible.

Currently you disable the No_Image image by simply deleting it! This approach was chosen as it allows the user to substitute a different default image - and use a unique one per Section.

But I don't know what the To DO one is about. Pending article email notification via email just like News already exists. (Plus it includes the Intro section so you can pre-screen spam before making the effort to log in.) That's how I knew that you'd posted this new Article.

You can upload a zip of just the changes to Downloads instead if you wish. Or PM me, and I'll give you an email addy to send it to.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Jun '09 Tue Jun 23, 2009 22:22    
masino_sinaga
Developer  Developer
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

- layingback

Need to think about Forum by Category (vs just Section)... I don't want to increase the db i/o if at all possible.

Sorry for my previous explanation.

I mean like this:
Currently, if we choose a certain forum from Section form in Pro_News panel admin, then all categories under this section will automatically using the same forum (based on forum selection in Section form).

Let's say in Pro_News we have:

* Section 1
- Category 1.1
- Category 1.2
* Section 2
- Category 2.1
- Category 2.2

and on the other side, we have the structure in Forum like this:

* Category 1
+ Forum 1
- Sub Forum 1.1
- Sub Forum 1.2
+ Forum 2
- Sub Forum 2.1
- Sub Forum 2.2
+ Forum 3
* Category 2
+ Forum 4
+ Forum 5

So, in current condition: If I choose "Forum 1" selection for "Section 1", then all categories under "Section 1" (Category 1.1 and Category 1.2) will be associated with Forum 1 only. This condition I don't want to use.

All that I need is like this:
- Category 1.1 will be associated to Sub Forum 1.1
- Category 1.2 will be associated to Sub Forum 1.2
- Category 2.1 will be associated to Sub Forum 2.1
- Category 2.2 will be associated to Sub Forum 2.2
- and so on...

In other words: I need that each Category under the Section in Pro_News will be associated to different forum id based on forum selection in Category form. With my modification, we can override forum selection in that Section form.

If admin select "none" (default setting) for forum selection in Category form, then the forum selection in Section form will be used for all Categories under its Section.

I think my explanation above is quite clear, now... Wink

I only added 3 new fields in pronews_cats table. I think in this case, we will not increase the db i/o... because the logic is not too different with the logic that being used by Section.

- layingback

Currently you disable the No_Image image by simply deleting it! This approach was chosen as it allows the user to substitute a different default image - and use a unique one per Section.

I know about it. I didn't disable by deleting it. There is a question then... Why? Because, actually, the "No Image" holder is still useful at the moment. Yessss! You can still use it if you want to show the same picture for articles that has no image at all on it. In other words: This is kindly like the same picture that you can re-use. So? I then add an option in admin panel, whether to show this picture or not. But I don't want to remove the code. I hope my explanation is quite clearly now....

- layingback

But I don't know what the To DO one is about. Pending article email notification via email just like News already exists. (Plus it includes the Intro section so you can pre-screen spam before making the effort to log in.) That's how I knew that you'd posted this new Article.

Yes, I saw the code regarding this. But it depends on setting in News module. I think it's better to use the same setting from config admin panel in Pro_News. That is why I made it. Please feel free to discuss more about this. Wink

Besides that, I also added a new option in config admin panel. It is "Notify user of approving articles". If set to "Yes" then send email notification to the sender of article when an article has been approved by admin, and vice-versa. This setting is useful if sometimes you don't want to let the user/article's sender know about you approve the article. Let's say the article contains wrong information, then you have to change and edit the whole content and change the article sender with administrator rather than to remove it.

I think that's all for this time. Thank you.

Best regards,
Masino Sinaga



masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
23 Jun '09 Tue Jun 23, 2009 23:04    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

Pending Article notification was not in admin_functions by design because I figured you'd already know about it if you'd posted it yourself! Wink Plus any submission by an admin is automatically approved - even if using the user side Submit Article. So no need for an email. Even with > 1 admins, they can all approve their own posts, so no need to notify/request approval from another admin.

The existing code to generate the pending article email is in functions.php, search for

PHP:
if ($gblsettings['notify'] && $id == '') {



No, I understand how the Section/Category/Forum would work. But if it doesn't increase the db I/O at runtime (ie. in functions.php), then I'm all for it. E.g. if Display By is Articles Only, then does it need extra/slower I/O to get the Category record just to get the Forum ID override? I guess it doesn't any more because the addition of past new features appear to have already incurred the need db I/O for Category for other reasons, so now it is "free"! So this is a big feature for many users of Pro_News. I would change "None" to "Default Section Forum", but otherwise it's all good. Thanks!

I'm still a bit worried that the No Image option may add confusion as well as more flexibility - too many ways to do the same thing! Remember that I have to support this module! Wink but I'll try it and see before making up my mind. Worse case we can always add a Config option to enable/disable the entire feature, and default it to off, so it is still present for those that understand it.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Jun '09 Tue Jun 23, 2009 23:27    
masino_sinaga
Developer  Developer
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

- layingback

Pending Article notification was not in admin_functions by design because I figured you'd already know about it if you'd posted it yourself! Wink ...

Understood. Wink
Actually, I edited my last pos a few seconds before you send this reply. Please, see my reason why I made and used independent setting in Pro_News config rather than using config in original News module. Wink

Speaking about forum selection by category whether it will slower or not, I know, there is always the advantage and disadvantage regarding this. If we don't use this feature, then we can only put all articles from many categories to only one Forum ID! And this is not flexible, I think. Crying or Very sad

So, in my humble opinion, this new feature will not too heavy to search forum_id whether based on section or category. Why? Because, the first check always to pronews_cats table, and if no forum id defined in this table, then get the forum id from pronews_sections table (using the default setting). Besides that, this is only needed to generate the topic in specified forum. And this is not too often being used. Moreover, the default forum selection setting in Category form is "None". Smile

- layingback

I'm still a bit worried that the No Image option may add confusion as well as more flexibility - too many ways to do the same thing! Remember that I have to support this module! Wink but I'll try it and see before making up my mind. Worse case we can always add a Config option to enable/disable the entire feature, and default it to off, so it is still present for those that understand it.

Thanks.
As I mentioned above, there is always advantage and disadvantage about something. Again, I have to say that this option is useful, since there is no option to use re-use image for article that has no image. So, by using this way, we can change "No Image" image file with another image without "No Image" text on it. That's the idea, I think. Wink

It is so nice to discuss with you, layingback. Love too much this module! Cool

Best regards,
Masino Sinaga



masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 01:59    
masino_sinaga
Developer  Developer
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

Dear layingback,

I've just uploaded Pro_News version 3.2 to Download section of this website.

Thank you for your time to test it. Wink

Best regards,
Masino Sinaga



masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 04:49    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

Thanks for the update. Have taken a quick look through. Most seems to make sense to me, although I'll need to look at the extra db i/o in functions.php again to feel comfortable Wink

But tell me why you added:

3. Added validation before INSERT INTO article to database, whether the article already exists or not, both in client and admin panel. If the article already exists in database, then do nothing, else execute the INSERT INTO sql. This is very useful to avoid spam article if submitted by registered user.

again please.

I can't see the issue that you are trying to guard against. The article id is null as it is a new article...

Also the reversion of image method means that transparent mode is lost for .png (and .gif) images. What sort of "quality loss" are you refering to?

TIA!



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 10:12    
masino_sinaga
Developer  Developer
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

- layingback

... But tell me why you added:

3. Added validation before INSERT INTO article to database, whether the article already exists or not, both in client and admin panel. If the article already exists in database, then do nothing, else execute the INSERT INTO sql. This is very useful to avoid spam article if submitted by registered user.

again please.

I can't see the issue that you are trying to guard against. The article id is null as it is a new article...


Well, the reason for this is more-less like this. When user or client submit article from front page of our website, after he/she clicks the Submit button, then there will be confirmation page appears that tell him/her about the submission is succeeded. When this page is being refresh or reload by client, then the same article that has just been added before would be saved in database again (this will re-execute the INSERT INTO sql), even the article id is null as you mentioned above.

That is why I check it based on its title and intro of the article. I think this really makes sense... especially for those who have slow connection after they submit article, the confirmation page that tell them whether the article has been saved or not is rather too long to display (in fact, the article was succeeded saved in database at that time).

So, when user refresh the page (can't wait to see confirmation page), then Pro_News should validate first whether the article has been saved or not. Without this validation, the double article content (at least we can check it based on its title and intro) will be saved in database. So, we have to prevent this happen. Wink

- layingback

Also the reversion of image method means that transparent mode is lost for .png (and .gif) images. What sort of "quality loss" are you refering to? TIA!


The reason why I used the method in version 3.0.0.1 for reversion of image is something like this: Let's say we have image which has text with Arial 26 font bold... I know, you can imagine how it looks like... yes... the font is black-bold... and when I used the reversion of image method in version 3.1, then this quality of font will decrease... the quality of font become not too good, something like there is a white-hole in font body; not black color in the whole font body. But I am not sure whether this is also happened to you and others. Please CMIIW for this.

Thanks.

Best regards,
Masino Sinaga



masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 14:49    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

OK, understand insert now (actually had figured that out for myself after I'd "slept on it").

On ImageMagick can I get some specifics please? What version of IM are you using on your server? (I'm using 6.4.5 on both my server and my dev system.) What type of file gave you problems, e.g. jpg, gif or png? Any chance of a sample of results from both methods?

If problem was with jpg, then I'll simply use old method for jpg (which doesn't handle transparency) and the new method for gif and png. If gif then I guess I could make it an option for gif ... Otherwise I'll have to get fancier still.

[ If I have to change this area, I'm also thinking of adding a max image size function. On client sites, not this one, I often have trouble with people uploading 2048-plus as it comes from the camera images without resizing to say 800 max first. So I'm thinking of resizing anything bigger than new max size, and ditching the original ... ]



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 15:36    
masino_sinaga
Developer  Developer
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

Honestly, I have no idea about ImageMagick. I am running Wampserver 2.0 with OS: Windows XP. It was happened at my development system, and not on live server: Linux (Sorry, I have not tested it in Linux, yet). I am not sure, whether it's because memory-leak or something else causes?

It seems that the problem is for file type .gif (I attached the image) and this is happened to "thumb_xxx.gif" file, the other 2 files are normal.

Best regards,
Masino Sinaga

  • 1245831657.6732.gif
  • 1245831657.6732.gif
  • Original image file
  • icon_1245831657.6732.gif
  • icon_1245831657.6732.gif
  • Icon file
  • thumb_1245831657.6732.gif
  • thumb_1245831657.6732.gif
  • Thumb file


masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 21:48    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

Forget ImageMagick - I'm confusing projects! In this module we're using the PHP GD2 library.

I see the issue all right. First thought is to use the new method on png and stick to old way on gif and jpg (the latter doesn't handle transparency anyway). But it should be possible to support transparency on .gif. It is odd that it doesn't happen with icon - too small?

But I think I see the problem ... need to try a different way to build the base image - currently it is using black as the transparent colour, which is quite possibly the cause.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
24 Jun '09 Wed Jun 24, 2009 22:30    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

OK, try this change if you would please.

In admin_functions.php look for:

PHP:
					imagecolortransparent($small, imagecolorallocate($small, 0, 0, 0));


and replace with:

PHP:
					imagefilledrectangle($small, 0, 0, $sizemin[0], $sizemin[1], imagecolorallocatealpha($small, 255, 255, 255, 127));


and look for:

PHP:
				imagecolortransparent($tiny, imagecolorallocate($tiny, 0, 0, 0));


and replace with:

PHP:
				imagefilledrectangle($tiny, 0, 0, $sizemin[0], $sizemin[1], imagecolorallocatealpha($tiny, 255, 255, 255, 127));



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
25 Jun '09 Thu Jun 25, 2009 09:42    
masino_sinaga
Developer  Developer
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

I have tested it using your newest method. It works very good now. The quality of image is good and back to normal now. Thanks for the great job, layingback! Cool

Do you think I should use the newest method with your change above? Or any other change for this method before I use it permanently?

One more thing... before I forgot, I just wanted to remind you about changing my status from "Translator" to "PHP Code Blender" as you promised me a few days ago. Thanks again. Wink

Best regards,
Masino Sinaga



masino_sinaga's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux / 2.2.11 (Unix) / 5.0.77-community- log / 5.2.9 / 9.2.1

 
 
 
 
  
25 Jun '09 Thu Jun 25, 2009 13:13    
layingback
Site Admin  
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

I'll get to the status change, don't worry Wink

I'm building 3.2.0.1 now, to incorporate your changes. (Else you'll have to do it all over again with the next Pro_News release.) But fighting bugs in cpg_inst.php still at the moment...

The above change to admin_img() will be included, ie. become permanent. There will also be the same change in functions.php of course.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
25 Jun '09 Thu Jun 25, 2009 15:15    
rosbif
BetaTester  BetaTester
  •  

Post Re: Pro_News version 3.2: Lots of Improvement

- layingback

[ If I have to change this area, I'm also thinking of adding a max image size function. On client sites, not this one, I often have trouble with people uploading 2048-plus as it comes from the camera images without resizing to say 800 max first. So I'm thinking of resizing anything bigger than new max size, and ditching the original ... ]


That would be great - it's a bit of a pain having to remind people to resize before posting...



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
Link  QR 
Share this Printer Friendly Page  facebook   google+   linkedin   twitthis  
Show more ...
Go to page  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next


Go to page  2, 3, 4, 5, 6, 7, 8, 9, 10  Next