custom image buttons for each catagory

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

custom image buttons for each catagory

Postby Esstee » Sat May 28, 2005 2:46 pm

I have been looking into getting an image solution with Coranto for our
newsroom.

The problem is NetPBM for starters, my hosting co. does not offer this
and after a few atttempts with pre-compiled binaries I decided 2 days
was enough time waisted on that.

What I'm after is a way to upload and auto resize images for each
news category ex:

Main newsroom headline image: size 350 x 250
Industry news teaser strip: 100 x 90

I was thinking of using a phpthumbnail maker script called
phpThumb(). now tis little guy uses GD v2.0+ which I have and
creates the following options:

<IMG SRC="phpThumb.php?src=/image.jpg&w=100">
<IMG SRC="phpThumb.php?src=http://example.com/foo.jpg">

So I was wondering, is it possible to have a button in the submit news
section that could upload an image and apply that tag when you clicked
submit?

this way I could make two buttons, 1 for headline story and one for
teaser stories that people could just click on find the image and
it would be refitted to the appropriate image size format for that
news layout.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Esstee » Sat May 28, 2005 4:01 pm

To help clearify my request I have made a quick visual aid of what I think
would work, what I want to know is if this could be done using an existing
script or ... would it be hard to accomplish this using coranto alone?

Image
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Re: custom image buttons for each catagory

Postby Parahead » Sat May 28, 2005 6:28 pm

Esstee wrote:I was thinking of using a phpthumbnail maker script called
phpThumb(). now tis little guy uses GD v2.0+ which I have and
creates the following options:

<IMG SRC="phpThumb.php?src=/image.jpg&w=100">
<IMG SRC="phpThumb.php?src=http://example.com/foo.jpg">

So I was wondering, is it possible to have a button in the submit news
section that could upload an image and apply that tag when you clicked
submit?

this way I could make two buttons, 1 for headline story and one for
teaser stories that people could just click on find the image and
it would be refitted to the appropriate image size format for that
news layout.
Can´t you use Multipart for the upload of the image without the thumbnail feature. That would give you the "image browse/upload"-button at the submit news page and then you apply the phpTumb-tag within the style? I guess the images should be at fixed positions anyway? So something like this would work:
Code: Select all
<IMG SRC="phpThumb.php?src=<FilePath: [MULTIPART_UPLOAD_FIELD]>&w=100">


If you don´t want the images at fixed positions but instead defined when submitting the newsitem, you should be able to replace some bbCode like img-tag to what you want using the Anne Rice addon or the method described in this thread.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Esstee » Sat May 28, 2005 8:01 pm

Parahead

That would work, my only gripe with that is the news submitters
"bless there little souls" would most likely not be in good positions to
format the images, which is why I want to resize them accordling using
the thumbnail feature.

I guess ultimately the rhumbnail feature would work, my hosting company
was kind enough to install NetPBM on my server and gave me the path
however it still does not work it only produces 0K thumbnails.

But I do agree with you once again, ideally we would use multipart and
I would create individual sections to choose images from for the
news submitters. This would accomodate them nicely since most of
the time those persons are off location.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Esstee » Sat May 28, 2005 8:16 pm

BTW. I will try your approach :)

My tiny brain is overheating atm. from all the Coranto style, feilds and
template settings I have been manipulating over the past few days.

My wife has been after me to finish some carpentry in our basement as well
so I guess its a good time to step back and try to absorb your information
before hacking away at the settings once again :)

I should be back at it late this evening. :D
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Esstee » Sat May 28, 2005 8:21 pm

you apply the phpTumb-tag within the style


Can you tell me how I would accomplish that?
I know I could but code against the tag but don't I have to replace some of
the code?
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Esstee » Sun May 29, 2005 12:09 am

okay I used this line:
Code: Select all
<IMG SRC="phpThumb.php?src=<FilePath: [MULTIPART_UPLOAD_FIELD]>&w=100">


in my teaser style to test and the phpThumb.php script did come on
but the image path was not found, here is my own line:
Code: Select all
<IMG SRC="./imgdata/phpThumb.php?src=<FilePath:CustomField_mutlipart>&w=210">


This is the resulting path from my browser:
Code: Select all
http://www.mysite.comt/imgdata/phpThumb.php?src=<FilePath:CustomField_mutlipart>&w=210


Any ideas where I went wrong?
my multipart field ID is CustomField_multipart
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby InSAnE NiNjA » Sun May 29, 2005 12:47 am

dont use multipart filepath.. because i'm assuming your using the url path instead of internal path, which is probably what the script is looking for
..nuttier then a squirrel turd..
User avatar
InSAnE NiNjA
 
Posts: 1213
Joined: Sat Jan 25, 2003 6:35 am

Postby Esstee » Sun May 29, 2005 1:07 am

Well I may have found a way around it, although I have not done any
further testing, I changed the multi path to internal instead of url and
it works.

I will try some different configurations to see if it affects my multipart
function, but since this will only be used for one particular image
upload placement this approach may work out.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Esstee » Sun May 29, 2005 1:38 am

Well it was fun while it lasted :)

it does work with my initial image thumbnail script if I try to use the
multipart path in maginot it does not play nice at all.

I'm ot even sure if multipart path can work in maginot either
so I might be trying to do something totally out of round.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby InSAnE NiNjA » Sun May 29, 2005 1:54 am

put phpthumb,php in the same folder as the images to be thumbed.. and then dont use a path, use just the filename of the images
..nuttier then a squirrel turd..
User avatar
InSAnE NiNjA
 
Posts: 1213
Joined: Sat Jan 25, 2003 6:35 am

Postby Esstee » Sun May 29, 2005 2:02 am

Well okay.

But what about using my <FilePath: CustomField_headline_image> ?
Can this be used in a maginot static template?

and if so what tag do I use?
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby InSAnE NiNjA » Sun May 29, 2005 2:27 am

the idea is its probably using /this/way/to/path ... which the php sees as wrong and looks in the wrong area...

use just the filename, or adjust the path yourself
..nuttier then a squirrel turd..
User avatar
InSAnE NiNjA
 
Posts: 1213
Joined: Sat Jan 25, 2003 6:35 am

Postby Parahead » Sun May 29, 2005 4:44 pm

Esstee wrote:okay I used this line:
Code: Select all
<IMG SRC="phpThumb.php?src=<FilePath: [MULTIPART_UPLOAD_FIELD]>&w=100">


in my teaser style to test and the phpThumb.php script did come on
but the image path was not found, here is my own line:
Code: Select all
<IMG SRC="./imgdata/phpThumb.php?src=<FilePath:CustomField_mutlipart>&w=210">


This is the resulting path from my browser:
Code: Select all
http://www.mysite.comt/imgdata/phpThumb.php?src=<FilePath:CustomField_mutlipart>&w=210


Any ideas where I went wrong?
my multipart field ID is CustomField_multipart
The [MULTIPART_UPLOAD_FIELD] was just a placeholder for the real name of the CustomField_XX, so you are correct that you must replace it with 'CustomField_mutlipart' in your case. Do I spot a typo though?

Also, please note that since you still see the FilePath-tag in your HTML output if you do a View Source indicates that it isn´t parsed. I would say that since you haven´t a space between the semicolon and your fieldname that is what is causing you problem.... Try this (mind that I haven´t changed the Multipart-typo though):
Code: Select all
http://www.mysite.comt/imgdata/phpThumb.php?src=<FilePath: CustomField_mutlipart>&w=210


InSAnE NiNjA wrote:the idea is its probably using /this/way/to/path ... which the php sees as wrong and looks in the wrong area...
No, this is not the case, the FilePath-tag uses the http-path.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden


Return to Customization

Who is online

Users browsing this forum: No registered users and 6 guests

cron