PDA

View Full Version : postbit_attachment differs depending on forum


Tim Wheatley
10-18-2002, 09:25 PM
This is the code I'm sure I need to edit:

if ($post[attachmentid]!=0 and $post[attachmentvisible]) {
$post[attachmentextension]=strtolower(getextension($post[filename]));
$post['filename'] = censortext(htmlspecialchars($post['filename']));
if ($post[attachmentextension]=="gif" or $post[attachmentextension]=="jpg" or $post[attachmentextension]=="jpeg" or $post[attachmentextension]=="jpe" or $post[attachmentextension]=="png") {
if (($viewattachedimages) and ($bbuserinfo[userid]==0 or $bbuserinfo[showimages])) {
eval("\$post[attachment] = \"".gettemplate("postbit_attachmentimage")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} else {
$post[attachment]="";
}

It's the line in here which is 5 from bottom and 7 from bottom I want to edit, and I think it'll be something like this?

if ($forum[forumid]==67) { //Grand Prix Legends AddonsEdits
eval("\$post[attachment] = \"".gettemplate("postbit_attachment2")."\";");
} else if ($forum[forumid]==36) { //GPL Main Forum
eval("\$post[attachment] = \"".gettemplate("postbit_attachment3")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}

But how do I enter this into the code above without screwing it up? :)

Tim Wheatley
10-18-2002, 09:36 PM
Nevermind, done it, simply replace this line:
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");

It appears twice, both times REPLACE with:

if ($forum[forumid]==67) { //Grand Prix Legends AddonsEdits
eval("\$post[attachment] = \"".gettemplate("postbit_attachment2")."\";");
} else if ($forum[forumid]==36) { //GPL Main Forum
eval("\$post[attachment] = \"".gettemplate("postbit_attachment3")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}

The reason for this? We're having some legal issues with copyright, we needed to put disclaimers in certain download forumt to tell users not to repost on other sites.