phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

easyCMS thumbnails

Goto page 1, 2  Next
 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Sun Sep 26, 2010 11:03 am 
Post subject: easyCMS thumbnails

Hi! Good response here lately so i throw in one more question. And then i will be quiet for a while. icon_smile.gif

The easyCMS system is a complete and good system with lots of features and we recently started to use it for adding hero-articles. One thing that is bugging me is that you cant add thumbnails to each article. So it look kinda 1990'ish. Old.. With the "Article Icon Manager" (plugin found on phpbbhacks) you can add more category images and place them in front just as thumbnails with some trixing and fixing in the templates. First i was thinking that this ICON system could be used as a thumbnails system but in the long run this is not a solution because the posting screen fills up with thumbnails(category "icon" images). And when you start to get many this becomes a huge mess. Does anybody in here have a better solution for adding thumbs to the articles? Or sort icons in category dropdowns or something. Any ideas?

easyCMS files and mods here:
http://www.phpbbhacks.com/category/35/


The icon bit in the template looks like this:

Code:
<tr>
     <td class="row1"><span class="gen"><b>{L_ARTICLE_ICON}</b></span></td>
     <td class="row2"><span class="genmed">
      <input type="radio" name="icon" value="0"{S_ICON_CHECKED}/>{L_NONE}&nbsp;&nbsp;
      <!-- BEGIN iconcol -->
      <input type="radio" name="icon" value="{iconcol.ICON_ID}"{iconcol.S_ICON_CHECKED}/><img src="{iconcol.ICON_IMG}" />&nbsp;&nbsp;
      <!-- END iconcol -->
     </span></td>
   </tr>


I will try to sneak in a ajax dropdown thingy in the code over but it isnt really a solution. Hope you have som clever and better ideas. Appreciate it! icon_biggrin.gif

Thomas
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Sun Sep 26, 2010 3:27 pm 
Post subject: Re: easyCMS thumbnails

I'm more of a visual guy. Can you post a screenshot of what you're trying to achieve on the article page and the admin page? Also, do you want the thumbnail to link to the image file, to a page that shows the image, or just not link to anything (or to the article)? And will you be using a different image for every article or a certain set?
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Sun Sep 26, 2010 4:33 pm 
Post subject: Re: easyCMS thumbnails

Cool! Yes the thumbnail should link to the article. Want to be able to add 1 thumbnail image for every article when i write or edit the article.

How i add thumbnails today:
1. upload thumbnail to spesific folder via FTP.
2. goto ACP and "add" thumbnail. See add-icon-acp.jpg
3. write article and select thumbnail in the top of post(add-article.jpg)

Difficult to update and the thumbnails will fill up the posting page(now it is only 3 there. add-article.jpg, cms_post_article.php). The linking to the article i can do in the template so i think i can figgure that out. But adding thumbnails on the fly when writing articles is more tricky.

What do you think?



article-overview.jpg
 Description:
 Filesize:  41.95 KB
 Viewed:  704 Time(s)

article-overview.jpg



add-icon-acp.jpg
 Description:
 Filesize:  86.56 KB
 Viewed:  697 Time(s)

add-icon-acp.jpg



add-article.jpg
 Description:
 Filesize:  77.11 KB
 Viewed:  710 Time(s)

add-article.jpg


Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Sun Sep 26, 2010 4:48 pm 
Post subject: Re: easyCMS thumbnails

And this is how it can look like. Just select it(like you select avatar aso) and upload it from the browse button.


like-this.jpg
 Description:
 Filesize:  54.51 KB
 Viewed:  723 Time(s)

like-this.jpg



cms_post_article.zip
 Description:
cms_post_article.php

Download
 Filename:  cms_post_article.zip
 Filesize:  5.17 KB
 Downloaded:  697 Time(s)

Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Mon Sep 27, 2010 4:35 pm 
Post subject: Re: easyCMS thumbnails

All right. The way I see it, we're gonna use the avatar upload code and paste it into cms_post_article.php, changing the target directory and adapting whatever is specific to the avatars. I'm going to need the file size and image dimensions you want the thumbnails to be restricted to.

I'm going to need those files (probably not all, but just in case):
includes/cms_auth.php
includes/cms_functions.php
includes/cms_functions_post.php
cms_article_post_article.php
cms_article_posting_body.tpl
lang_cms.php
As well as the article template file and a copy of an article's page source, if possible, to help me see where everything goes. Oh and I see you have UploadPic in there, so please make sure you remove any MOD we won't be using from the files so I don't have to check which parts I can delete.

I hope you don't mind if I take my time, my fingers are wrecked at the moment (probably not gonna start today, maybe not even tomorrow); anyway if anyone else wants to tackle this, please do.
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Mon Sep 27, 2010 7:50 pm 
Post subject: Re: easyCMS thumbnails

That sounds like a good plan. icon_smile.gif Nice we can use it for this too! icon_biggrin.gif

Salvatos wrote:
file size and image dimensions

thumbnails are 160(wide)x80(high)
size limit 10KB

Quote:
As well as the article template file

Ok have attached the cms_article_posting_body.tpl and the cms_articles_body.tpl. This last one is where the thumbnails shows up(i also attached my modded file in a separate folder so you can see where i placed the "icon mod"). Included one set with fresh files from the install and my modded files. If it is easier for you to use the fresh files do that. I can take the time to find out where to place it in my live files afterwards(by comparing them). No problemo.

Quote:
copy of an article's page source

Do you mean a browser source of an page? The articles are always different. cms_article_posting_body.tpl is included in the zip attached. Let me know if you need something more and i will add it asap.

Yes ofcource! Glad you even have the time. Appreciate your help! Awesome!! icon_biggrin.gif



salvatos.rar
 Description:

Download
 Filename:  salvatos.rar
 Filesize:  46.58 KB
 Downloaded:  730 Time(s)

Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Mon Sep 27, 2010 9:55 pm 
Post subject: Re: easyCMS thumbnails

hoimyr wrote:
If it is easier for you to use the fresh files do that.

Thanks, it will definitely make things simpler. I'll try to write a MOD using the usual format instead of just posting the resulting files, so you can add everything step by step and adjust if necessary.

hoimyr wrote:
Do you mean a browser source of an page? The articles are always different.

Yes, that will help me visualise the template file if I don't end up testing the files on my forum. It's really just to see where everything's going instead of keeping track of all the <tr>'s and <td>'s.

I also forgot to ask for the cms language file. I'll probably have to add a couple messages for errors and the like and redirect those that come with the avatar uploads.
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Wed Sep 29, 2010 4:22 pm 
Post subject: Re: easyCMS thumbnails

Hi! Have been away from the computer. That sounds great! If i can assist in any way let me know.

Here is the cms language file and source overview page. The post article page has links to acp and so on so not shure if i can post it here? Is it safe? But if you need it mail me on thomas(alfa)3dhue.no and ill mail it to you asap.



source.rar
 Description:

Download
 Filename:  source.rar
 Filesize:  39.58 KB
 Downloaded:  705 Time(s)


lang_cms.rar
 Description:

Download
 Filename:  lang_cms.rar
 Filesize:  2.55 KB
 Downloaded:  721 Time(s)

Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Wed Sep 29, 2010 5:19 pm 
Post subject: Re: easyCMS thumbnails

I'm okay without the post_article source, I should be able to get around on the screenshot you posted earlier. And no worries on taking time to send the files, I ended up getting a rush assignment yesterday so I might not even be able to start this week. I'll let you know when I finally do icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Mon Oct 04, 2010 5:11 pm 
Post subject: Re: easyCMS thumbnails

I said I'd let you know when I started, so here, I did ^^ Looks like it'll be more complex than I hoped, though, and I'm still very busy (and in bad "manual" shape), so thanks for your patience icon_smile.gif

So far I'm looking at the functions and trimming what won't be necessary for us. I'll probably make it a little less secure than avatar upload because I don't get everything there, but as I gather it you're the only one with access to this, so it shouldn't be too much of an issue?
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Fri Oct 08, 2010 6:54 pm 
Post subject: Re: easyCMS thumbnails

Hi Hoimyr. I wanted to let you know I just got a new contract, which means less time and more aching. So it's gonna be a while until I can get to your MOD icon_sad.gif

I'd be really glad if someone else could tackle this for you icon_neutral.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Sat Oct 16, 2010 9:51 pm 
Post subject: Re: easyCMS thumbnails

Okay, I'm realizing I've been taking a very bad approach to the problem. Trying to get the avatar upload in there is way over my current skill, so let's try to improve on what you're using at the moment instead. We have a couple possibilites.

- Either we just fix the way the icons are shown if you're content with uploading them via FTP and adding them through the ACP. We could make it a pop up with miniatures like the smileys window, or a dropdown of the file names if you can navigate through that, etc.

- Either we change the concept a little, to the following for instance. You'll still be uploading the image manually to a specific folder, but the rest is much simpler. We can set the template so that it simply fetches an image that corresponds to the article's id. For instance, in article #23, the template would be attempting to display image 'images/article_icons/23.jpg'. This is easier to achieve if you're okay with always posting JPGs, or always PNGs, etc. but we can make it check for a couple extensions too (e.g. if no 23.jpg, check 23.png, else 23.gif, else give up). As we previously discussed, that icon would be a link to the article. You wouldn't have to do anything on the article creation page, just upload the file prior to publishing it. Caveat: You'd have to manually delete icons after deleting an article (mentioning it in case that's not already the case).

So let's see how simple the latter is.

OPEN cms_articles.php
REPLACE
Code:
    $article_icon = '';

    for( $j = 0; $j < count($icon_row); $j++ )

    {

        if( $icon_row[$j]['icon_id'] == $article_row[$i]['article_icon'] )

        {

            $article_icon = '<img src="' . $cms_config['icons_path'] . '/' . $icon_row[$j]['icon_href'] . '" width="160" height="80" alt="" border="0" hspace="3" />';

        }

    }

WITH
Code:
$article_icon = '<img src="' . $cms_config['icons_path'] . '/' . $article_row[$i]['article_id'] . '.jpg" width="160" height="80" alt="" border="0" hspace="3" />';

(I'd recommend setting an alt attribute though.)
As I said, I'm leaving it at .jpg, but we could add some extension testing before it, in the order of your choice, and display a "no icon" image if nothing is found.

OPEN cms_articles_body.tpl
REPLACE
Code:
{articlerow.ARTICLE_ICON}

WITH
Code:
<a href="{articlerow.U_VIEW_ARTICLE}">{articlerow.ARTICLE_ICON}</a>


And I reckon that would be most of it. Of course the best way to proceed would be to actually remove the icon MOD first if you won't be using it anymore, then apply the changes above, so your files will be cleaner. If that leaves you without the $cms_config['icons_path'] variables, just replace it with the actual path, I don't suppose it's gonna change often.

For convenience, I guess you should also add a little spot to cms_post_article.tpl where it displays the article you're writing's id so you know how to name the file and remember to upload it. Just add
Code:
'ARTICLE_ID' => $article_id,
somewhere around line 630 and echo it where you please in the .tpl using {ARTICLE_ID}. If you want text with it (not hardcoded into the template), add a string to the MOD's language file and call it using
Code:
'L_ARTICLE_ID' => $lang['Article_Id'],
like above and {L_ARTICLE_ID}. The rest is a matter of editing the template so it looks the way you want it.


Now that's quite a wall of text. Sorry for that and terribly sorry for keeping you waiting so long. I really should have thought about that earlier. Please don't hesitate to ask if you need more details/help.
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Sun Oct 17, 2010 7:23 pm 
Post subject: Re: easyCMS thumbnails

Salvatos wrote:
We can set the template so that it simply fetches an image that corresponds to the article's id.

This method is perfect. It simplifies the whole process alot. And i like that nothing has to be done when writing the article, just take a look at the ID and go to photoshop and ftp it. This is perfect!! icon_smile.gif
The two other can get messy in the long run but can be solutions as well. I think the first auto-version is the smartest. Cant wait to try it out hehe.

Quote:
display a "no icon" image if nothing is found.

This is a nice feature but all the articles will have an thumbnail so dont spent time on that. If it shows a red x its a fine reminder for me or one of the other admins/ mods that they have to make and upload the image.

Quote:
best way to proceed would be to actually remove the icon MOD first

Yes that sounds like a plan. No need for the icon mod now.
icon_biggrin.gif Thanks for the tips! Will start to remove it now.

Quote:
For convenience, I guess you should also add a little spot to cms_post_article.tpl where it displays the article you're writing's id

That is awesome. Simple and just what we need. Thanks for the detailed infos! icon_smile.gif

Really appreciate your help on this! You know what ill be doing the next hours hehe. Thank you for your time and coding. Good luck with the new project! icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 416
Location: Québec


flag
PostPosted: Mon Oct 18, 2010 1:33 am 
Post subject: Re: easyCMS thumbnails

I'm glad you liked the idea icon_smile.gif Let me know how it went!
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Mon Oct 18, 2010 4:46 pm 
Post subject: Re: easyCMS thumbnails

It is installed and it works perfect! icon_smile.gif Will setup some infos for my moderators now. icon_smile.gif Fixes like this makes it so much nicer and easy to update. Tanks again for your help!
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 2 All times are GMT
Goto page 1, 2  Next
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0820 seconds using 17 queries. (SQL 0.0025 Parse 0.0663 Other 0.0133)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo