Attachment Mod

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
2035
71%
Very Good
444
16%
Good
175
6%
Fair
54
2%
Poor
156
5%
 
Total votes: 2864

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51889
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Attachment Mod

Post by Brf » Wed Apr 11, 2007 12:15 am

sagenhoney wrote: Thanks Brf ......Wasn't sure if you were replying to me


Yes. Occasionally, I have seen other mods remove the {S_FORM_ENCTYPE} from the form tag in posting_body.tpl. You cannot upload without it.

User avatar
Socialoutcast
Registered User
Posts: 61
Joined: Fri Oct 20, 2006 2:43 am
Location: Scotland

Re: Attachment Mod

Post by Socialoutcast » Wed Apr 11, 2007 3:33 am

Hi I recently installed this great MOD and everything seemed to be going fine until I noticed when posting a reply this appears in the topic review
Could not obtain topic information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; attach_setup_viewtopic_auth(, ); AND f.forum_id = t.forum_id' at line 4

SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments FROM phpbb_topics t, phpbb_forums f WHERE t.topic_id = 5366 = ''; attach_setup_viewtopic_auth(, ); AND f.forum_id = t.forum_id

Line : 49
File : topic_review.php


I have looked at topic_review.php and I know it's probably something simple and it may well have been answered here already but I'm still a noob and reading through all the pages in this thread to find if it's already been solved would take forever so any help would be good of you

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17079
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attachment Mod

Post by DavidIQ » Wed Apr 11, 2007 3:39 am

This:

Code: Select all

attach_setup_viewtopic_auth(, );
Shouldn't be in there at all. Post your code around ine 49 of topic_review.php
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
Socialoutcast
Registered User
Posts: 61
Joined: Fri Oct 20, 2006 2:43 am
Location: Scotland

Re: Attachment Mod

Post by Socialoutcast » Wed Apr 11, 2007 4:57 am

Thanks for the quick reply DavidIQ here's the code around line 49
$sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
$tmp = '';
attach_setup_viewtopic_auth($tmp, $sql);
AND f.forum_id = t.forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$db->sql_freeresult($result);

$forum_id = $forum_row['forum_id'];
$topic_title = $forum_row['topic_title'];

//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//


I can't remember ever editing anything near this line when installing this MOD and from what I remember none of the other MODS installed even required opening the file

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17079
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attachment Mod

Post by DavidIQ » Wed Apr 11, 2007 11:41 am

Well here's your problem:

Code: Select all

$sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments 
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
WHERE t.topic_id = $topic_id
$tmp = '';
attach_setup_viewtopic_auth($tmp, $sql);
AND f.forum_id = t.forum_id";
Replace that with:

Code: Select all

$sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments 
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
WHERE t.topic_id = $topic_id AND f.forum_id = t.forum_id";

$tmp = '';
attach_setup_viewtopic_auth($tmp, $sql);
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51889
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Attachment Mod

Post by Brf » Wed Apr 11, 2007 11:42 am

Here is the relevant part of the instructions:

Code: Select all

# 
#-----[ OPEN ]---------------------------------------------
# 
includes/topic_review.php

# 
#-----[ FIND ]---------------------------------------------
# around line 43
			WHERE t.topic_id = $topic_id
				AND f.forum_id = t.forum_id";

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
		$tmp = '';
		attach_setup_viewtopic_auth($tmp, $sql);
For some reason, you added it in the middle of the lines you found, instead of after.

paulorton
Registered User
Posts: 153
Joined: Fri Jan 13, 2006 9:40 pm

Re: No download button after uploading files

Post by paulorton » Wed Apr 11, 2007 2:23 pm

paulorton wrote: This doesn't happen for all users but for many (including myself) uploading a file works fine but there is no button to click on to allow it to be downloaded. Does anyone recognise/have a solution to this problem?

Attachment Mod Version 2.4.5
Powered by phpBB 2.0.21 © 2001 phpBB Group


Sorry to reply to my own message but I'm starting to wonder if my question has not been noticed!
Paul Orton
phpBB 3.0.10

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51889
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Attachment Mod

Post by Brf » Wed Apr 11, 2007 3:19 pm

How are your permissions set in Forum Admin Permissions - Advanced Mode ?

User avatar
Socialoutcast
Registered User
Posts: 61
Joined: Fri Oct 20, 2006 2:43 am
Location: Scotland

Re: Attachment Mod

Post by Socialoutcast » Wed Apr 11, 2007 3:54 pm

Thanks for your help DavidIQ and Brf I figured it'd be something simply that I did wrong and it was :oops:

paulorton
Registered User
Posts: 153
Joined: Fri Jan 13, 2006 9:40 pm

Re: Attachment Mod

Post by paulorton » Wed Apr 11, 2007 4:04 pm

Brf wrote: How are your permissions set in Forum Admin Permissions - Advanced Mode ?


Was this directed at me? It's confusing because of the different subject title.

If so, they are set to Advanced and Download Files to REG.
Paul Orton
phpBB 3.0.10

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51889
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Attachment Mod

Post by Brf » Wed Apr 11, 2007 4:55 pm

What type of files are you seeing no download link for? and what are your settings for that file-extension group?

samik
Registered User
Posts: 5
Joined: Tue Apr 10, 2007 3:16 pm

Re: Attachment Mod

Post by samik » Wed Apr 11, 2007 8:18 pm

Please help me.
I installed phpbb version 2.0.22, attachment mod version 2.4.5, in web server-freeBSD,php- v. 4.4.3, appache.
File_uploads in php is set to 'on', upload_max_filesize=2MB.
While I attach a file, I press 'add attachment', the phpbb generates an upload error: could not upload attachment to ./files/filename. Upload directory permissions are set to 777.
Maybe something have to be changed or installed or smth. else.
Please give me some advice.

samik
Registered User
Posts: 5
Joined: Tue Apr 10, 2007 3:16 pm

Re: Attachment Mod

Post by samik » Wed Apr 11, 2007 8:18 pm

Please help me.
I installed phpbb version 2.0.22, attachment mod version 2.4.5, in web server-freeBSD,php- v. 4.4.3, appache.
File_uploads in php is set to 'on', upload_max_filesize=2MB.
While I attach a file, I press 'add attachment', the phpbb generates an upload error: could not upload attachment to ./files/filename. Upload directory permissions are set to 777.
Maybe something have to be changed or installed or smth. else.
Please give me some advice.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17079
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attachment Mod

Post by DavidIQ » Wed Apr 11, 2007 8:32 pm

Is the file system permissions for that directory set correctly? I'm not very familiar with Linux but on Windows the IISUSR account has to have write permissions to the files directory.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

paulorton
Registered User
Posts: 153
Joined: Fri Jan 13, 2006 9:40 pm

Re: Attachment Mod

Post by paulorton » Wed Apr 11, 2007 9:50 pm

Brf wrote: What type of files are you seeing no download link for?

jpg and tif
Brf wrote: and what are your settings for that file-extension group?

I'm not sure. Where would I set these?
Paul Orton
phpBB 3.0.10

Post Reply

Return to “[2.0.x] MOD Database Releases”