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.

topic images

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



Joined: 04 Jun 2011

Posts: 35



PostPosted: Wed Jun 15, 2011 3:19 pm 
Post subject: topic images

Anybody knows if there is a mod around (even DEV or ABD) that could "grab" the first image* of the first post of all topics and show it in viewforum?

i am talking about a new column in viewforum, before or after the topic title.


anybody seen something like that anywhere?


*images hosted remotely, not attachement. Talking about the content of the first [img ] tag.
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Fri Jun 17, 2011 6:41 am 
Post subject: Re: topic images

no one has any idea?

what i want to achive is similar to this in viewforum. maybe it can be done with attached images? or with remote images on various pic hosts?



example.png
 Description:
 Filesize:  35.8 KB
 Viewed:  1061 Time(s)

example.png


Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 425
Location: Qu├ębec


flag
PostPosted: Fri Jun 17, 2011 4:47 pm 
Post subject: Re: topic images

I don't know of such a MOD (didn't find one on phpBBHacks either), and it would be a lot of work to implement. Well, that's relative, but it would be a bit much for me.

The way I imagine it, you would have to:

- In viewforum, scan the entire content of each thread to find the first [img] tag. If none is found, display a custom icon.

- If an image is found, grab the URL, resize it and add it to the thread's row on viewforum.

I don't know much about these things, but I am under the impression it would slow down the page a good deal. Would be better if you're just checking the first post, though. Since you're resizing the images, I'm also not sure whether you would have to host a copy on your server, but there's probably a way to avoid that.
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Fri Jun 17, 2011 10:15 pm 
Post subject: Re: topic images

i found a pretty elegant method for doing this, based on a commercial MOD that i have.

only thing i need is to enable bbcode now (to show the images) but i dont know how to do it

if anyone can help me please read this topic
http://www.phpbb2refugees.com/viewtopic.php?t=799
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Wed Jun 29, 2011 10:06 am 
Post subject: Re: topic images

I rented a coder for making a manual uploading of thumbnails some years ago. Nice feature but it just gets messy right away when some of the thumbnails are missing.
What i need now looks the same as yours but it has to work with the attachment mod. And it must create small thumbnails of the bigger image 100% automatic. No html-scaling but scaled down and cached. GD. All the attachments in the attachment-mod are stored in a big register so it is possible in php/sql to track where the images belong. If you use external images linked in with IMG this system wont work thoug.. I will spend some bucks and hire a coder later on(i currently have a coder working on other projects). If someone wants the same thumbnail-mod let me know so we can split the cost and make him install it on multiple sites. I will start on this in August..
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Wed Jun 29, 2011 1:09 pm 
Post subject: Re: topic images

i did it and it works pretty fine and it does not get messy when an remote image url is broken. I use a default "onError" image that shows when there is no user submitted image url, or if the url is dead.

I use a php script for resizing the user submitted images to create 60x60 thumbs and store them in a local cache folder. So basically the images are remotely hosted but the thumbnails are on my server, great improvement for speed.

Here is a snapsot of how it looks in my website
Image link

What i did was to create a new topic property (similar to topic description), called "topic_thumb". This property is populated when a topic is submitted with the user submitted image.

Then i created a new column in viewforum where the thumb is shown after the resizing has taken place.

The resize php script http://www.binarymoon.co.uk/projects/timthumb
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Wed Jun 29, 2011 1:38 pm 
Post subject: Re: topic images

what i did is exactly what you describe here, except one thing: you do not really need attachements involved and you CAN use remotely hosted images and without any slow loading at all.

I could easily help you trough, its not that complicated but there is a problem.. It requires a commercial mod, that would cost some cash (i payed 300 euros 2 years ago for it). This mod will transform your posting.php on per-forum basis, to a posting template that looks like this

Image link

The content of each field of the posting template become a unique property of the post when the post is submitted. Any post submitted with the template, will always remain formatted, will always keep its properties.
So, when the image URL is submitted, it becomes a unique value of the specific post. You can easily do whatever you want with this, even resize and show a thumbnail in viewforum.

The posting templates are build by admin, very easy to create as many as you like. You can have different templates per forum. They support drop menus, radio buttons, mandatory fields, whatever you like. Its the real deal all the way through. And it is bugless - 2 years of testing, nothing is left to fix.

The features are too many too describe here... If you are interested, i will give you the email of the coder (the magician) who coded this.

EDIT: I do not try to SELL anything. I am not the coder.
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Wed Jun 29, 2011 1:49 pm 
Post subject: Re: topic images

and here is another solution that does not require commerial mods and no attachements needed.

1) Create a new column in the topics table. Lets call it 'topic_thumb'.

2) Create a new field in posting.php that will be ready to accept image url
whatever is submitted there, will populate the 'topic_thumb'.
You can easily do that if you 'clone' the topic_description mod. You will now have: topic_title, topic_desc (optional) and topic_thumb, 3 different field in posting.php.

3) Create a new column in viewforum_body.tpl and show your topic_thumb property there. Use the image resizing script in previous post to make thumbnails stored in your server cache.

I could probably do this for you (for free) but i am no coder, cannot promise results. But it works bugless in my forum, and i coded it by myself.
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Thu Jun 30, 2011 11:07 am 
Post subject: Re: topic images

Wow icon_eek.gif That is perfect!

I know i have downloaded a mod that gives an option to have a custom template in some categories. Can try to implement that instead of that big mod. But your second method also looks geniale!

Very interesting. I must do some testing and figgure out how i do it. I have a guy working on the attachment-mod so have to find a way for both systems. May work anyways. One automatic system and one manual. icon_smile.gif I will install Appserv and do a test tonight! If i get stuck i might drop a question here or two. icon_wink.gif

And thank you very much. Great work.
ps. You are a coder. icon_wink.gif

btw. Your site looks very nice!
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Thu Jun 30, 2011 2:18 pm 
Post subject: Re: topic images

tell me how it went .. icon_smile.gif
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Thu Jun 30, 2011 2:59 pm 
Post subject: Re: topic images

try this, it should work.

you will have to do some changes in the viewforum.tpl by your self according to your style. Some colspan increase etc, not difficult.

also you will need the php resizing script that you will find here
http://code.google.com/p/timthumb/

and follow the quite simple instructions for remote img resizing here
http://www.binarymoon.co.uk/2010/08/timthumb-part-2-external-websites/

This will give you a new field in posting, below the topic title. When an image url is submitted there (no bbcode or html, only the url), a thumbnail will show in viewforum.

EDIT
attachement deleted please check here
http://www.phpbb2refugees.com/viewtopic.php?p=6022#6022
for new version
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Sat Jul 02, 2011 10:36 am 
Post subject: Re: topic images

Thank you for step-by-step noisy!! icon_biggrin.gif
Awesome modification. Must have hehe. Have a great day!
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Sat Jul 02, 2011 11:06 am 
Post subject: Re: topic images

is it working? did you tried it? I am not a coder and i have never written a MOD before. I now its working bugless in my forum but still...

If you wait a few days, i will give you a MOD release that will be tested on vanilla phpBBv2 with full documentation, including CSS and viewforum_body.tpl changes in detail.

It will also include 2 different methods for resizing the images to produce thumbs. One with the resizing .php program (HQ thumbs, more bandwith) and one with simple CSS resizing (LQ thumbs, no bandwith penalty).

In general it is clean code and it doesn't include attachment mod or photo album by smartor or anything. But still it would be nice if an experienced coder could find time to review and 'validate'.

anyway, next version on the way...
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Sat Jul 02, 2011 12:52 pm 
Post subject: Re: topic images

Yes it works and i am testing now. It shows up and now errors here on my local test with AppServ. But the scaling is not working yet. I added a test-site with allowedSites in timthumb.php but still no resizing. It can have something to do with this local test enviroment. Going over the tim Thumb site again now. icon_smile.gif

I installed a fresh phpbb2 2.0.23 . It seems the line
Quote:

#-----[ FIND ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode,


shuld be

Quote:
#-----[ FIND ]------------------------------------------
#
$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode,


? We just have different versions of phpbb i think.

The thumb in viewforum could also be an link directly to the post. That had been cool. icon_smile.gif
Back to top
noisy
Board Member



Joined: 04 Jun 2011

Posts: 35



PostPosted: Sat Jul 02, 2011 2:28 pm 
Post subject: Re: topic images

in my forum the thumb links to the full size image but it could be link to the the topic of course.

You can easily allow all the remote sites by setting
Code:

define ('ALLOW_EXTERNAL', TRUE);


in timthumb.php

Then you will not have to make a list of allowed sites.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 3 All times are GMT
Goto page 1, 2, 3  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.0317 seconds using 18 queries. (SQL 0.0030 Parse 0.0025 Other 0.0262)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo