Previous Thread
Next Thread
Print Thread
Rate Thread
#206852 12/09/2000 4:00 PM
Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
i just modified eiliens Icons4Attachments Hack on her board to work with php. it adds an icon after the subject on the board, telling people that there is an attachement to this post or if there is a poll in this post. you can see an example of this in action at http://www.extremeforums.org/postlist.php?Board=testboard

if anyone wants to know how i did this, i will post instructions.

[:red]--------------
http://extremeforums.org/index

Sponsored Links
Joined: Jun 1999
Posts: 54
Member
Member
Offline
Joined: Jun 1999
Posts: 54
In reply to:

if anyone wants to know how i did this, i will post instructions.




Yes, Please, and Thanks.[]/w3timages/icons/wink.gif[/]


Joined: May 1999
Posts: 624
Master Hacker
Master Hacker
Offline
Joined: May 1999
Posts: 624
Fabulous! If you post the howto here I'd love to post it on Amdragon too. I'll make a new phpHacks board and of course credit you with its authorship.

[]http://www.amdragon.com/images/eileensig.gif[/]

Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
i actually am real dumb....i just upgraded to the latest php version yesterday while i was at work. BUT i forgot to backup the postlist.php . no big deal, again this was just your hack modified for php.

[:red]--------------
http://extremeforums.org/index

Joined: May 1999
Posts: 624
Master Hacker
Master Hacker
Offline
Joined: May 1999
Posts: 624
Aargh, don't you hate that!
Post it when you've reconstructed it.

[]http://www.amdragon.com/images/eileensig.gif[/]

Sponsored Links
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
did He every repost this I think thie is a very needed feature of the MB


Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
I guess not so I'll take a gander at coming up with one.... I'm not to be held accountable if it doesn't work because my forums are offline right now and I don't have a place to test it. So here it goes...

Modify line 23 which looks like this...

SELECT B_Number,B_Parent,B_Posted,B_Username,B_Subject,B_Status,B_Approved,B_Icon,B_Reged,B_Color,B_UStatus


By adding ",B_File" to the end to look like..

SELECT B_Number,B_Parent,B_Posted,B_Username,B_Subject,B_Status,B_Approved,B_Icon,B_Reged,B_Color,B_UStatus,B_File


Then take line 36... which looks like...

list($Number,$Parent,$Posted,$Username,$Subject,$Open,$Approved,$icon,$Reged,$Color,$PostStatus) = $dbh -> fetch_array($sth);


And make it...

list($Number,$Parent,$Posted,$Username,$Subject,$Open,$Approved,$icon,$Reged,$Color,$PostStatus, $File) = $dbh -> fetch_array($sth);


Then look for the section that starts...

// If the post isn't approved we show it in the new color


Right after the echo command in that section (the line right after it is line 887) add this...

if($File != NULL ) { echo "  <img src="$config[images]/attachment.gif\ alt="Attachment">" }


Please try it out and let me know. I'll gladly fix any problems but like I said... I have no way to test that out...

Oh and since technically it was poil's idea and he was suppose to post the code for it... I figured I'd post up his file attachment icon.. Don't be mad poil....



Doug
http://www.netherworldrpg.net
Attachments
33947-attachment.gif (0 Bytes, 29 downloads)

Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Ok i think i got this to work you forgot a quotation mark in your image tag for the image and I Had to add B_File to the SQL Query on line 556 and add $File to Line 709

also if its in threaded mode it will only show it in the first post of a thread


Joined: Oct 2000
Posts: 60
Power User
Power User
Offline
Joined: Oct 2000
Posts: 60
I'm currently working on converting the whole thing (using all the icons). Since PHP's ereg() function can duplicate perl's =~ function, it shouldn't be too difficult, just time consuming to check the various changes. I've noticed that to do the No Text, Edited, and Deleted hacks, the Body element must also be checked. I'm working on that, too.

Administrator, Videogame Music Archive

Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
instead of doing:

if($File != NULL ) { echo "  <img src="$config[images]/attachment.gif\ alt="Attachment">" }

you can pop in:

if ($File) {
if (ereg(".DOC",$File)) {
echo "  <img alt = "Doc Attached" src="$config[images]/a-doc.gif" width=16 height=16 hspace=1>";
}
elseif (ereg(".TXT|.PL|.CGI",$File)) {
echo "  <img alt = "Textfile Attached" src="$config[images]/a-txt.gif" width=16 height=16 hspace=1>";
}
elseif (ereg(".HTM|.SHTM",$File)) {
echo "  <img alt = "Webpage Attached" src="$config[images]/a-htm.gif" width=16 height=16 hspace=1>";
}
elseif (ereg(".XLS",$File)) {
echo "  <img alt = "Spreadsheet Attached" src="$config[images]/a-xls.gif" width=16 height=16 hspace=1>";
}
elseif (ereg(".PDF",$File)) {
echo "  <img alt = "PDF Attached" src="$config[images]/a-pdf.gif" width=16 height=16 hspace=1>";
}
elseif (ereg(".ZIP|.TAR|.GZ",$File)) {
echo "  <img alt = "Zip Attached" src="$config[images]/a-zip.gif" width=16 height=16 hspace=1>";
}
elseif (ereg("gif|jpeg|jpg|bmp",$File)) {
echo "  <img alt = "Picture Attached" src="$config[images]/a-pic.gif" width=16 height=16 hspace=1>";
}
elseif (ereg("WAV|.MP3|.AU|.SND|.RA|.RM|.MID",$File)) {
echo "  <img alt = "Sound Attached" src="$config[images]/a-sound.gif" width=16 height=16 hspace=1>";
}
elseif (ereg(".MOV|.MPG|.AVI",$File)) {
echo "  <img alt = "Video Attached" src="$config[images]/a-video.gif" width=16 height=16 hspace=1>";
}
else {
echo "  <img alt = "Attachment" src="$config[images]/a-clip.gif" width=16 height=16 hspace=1>";
}
}

if ($Poll) {
echo "  <img alt = "Poll" src="$config[images]/pollpic.gif" width=16 height=16 hspace=1>";
}

if (ereg("(No Text)",$Body)) {
echo "  <img alt = "NoText" src="$config[images]/notext.gif" width=15 height=15 hspace=1>";
}
if (ereg("Post deleted by",$Body)) {
echo "  <img alt = "Deleted" src="$config[images]/deleted.gif" width=15 height=15 hspace=1>";
}
if (ereg("Edited by",$Body)) {
echo "  <img alt = "Edited" src="$config[images]/edited.gif" width=15 height=15 hspace=1>";
}


should do the trick, and add images accordingly...

[:red]--------------
http://extremeforums.org

Sponsored Links
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
I could if I wanted to get complicated.... []/w3timages/icons/smile.gif[/] But I didn't wanna get complicated when I made the code. But if you look at your code there are several bugs in it.

First off you need to use eregi() because you need a case-insensetive search. Secondly, every file extension needs to be '.gif' and not just 'gif'. Instead of doing echo " startcode"; with those spaces in front you need to use  's to space it out. Other then those things, it should work fine.


Doug
http://www.netherworldrpg.net

Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Thx for doing this. I haven't had time to do this.

Doug
http://www.netherworldrpg.net

Joined: Oct 2000
Posts: 60
Power User
Power User
Offline
Joined: Oct 2000
Posts: 60
OK, this should be the finished version of it. There's even a new feature: You can now click on the icons themselves to load the attached file.

Administrator, Videogame Music Archive
Attachments
35133-Icons4Attachments-Regular.txt (0 Bytes, 47 downloads)


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)