The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Special Mod Not Working Anymore
For the most part our upgrade from 3.6.7 to 4.1.12 went off without a hitch, but there was one casuality in particular. Our chess viewer.
It worked previously by someone attaching a pgn file to their post and it would automatically appear when the person pressed the post button and it would display in their post. But no longer. Here is a picture of the chess board applet that would appear in a person's post: http://chess.geniusprophecy.com/chess-viewer.html Okay, so the instructions for installing this are here, close to the bottom of the page. http://chesstuff.blogspot.ca/2008/11...er-deluxe.html Now Viewer-Deluxe.jar is installed in my forum's root directory so I think the problem here is simply telling vBulletin that when someone attaches a pgn to their post, open it with Viewer-Deluxe.jar. The million dollar question is how? |
#2
|
|||
|
|||
Seems like you must have had some sort of modification to handle that. I guess what you'd need to do is somehow detect that someone is attaching that kind of file and insert code in the post to display the applet (as it says in the instructions you provided). Do you have any mod or plugin that maybe is installed but isn't working now? Or did you maybe make any code changes to the vb3 code?
|
#3
|
||||
|
||||
It does say you need to add code to that page for it to run - have you added it?
|
#4
|
||||
|
||||
Quote:
Do you by any chance know what template I need to add this code to? |
#5
|
|||
|
|||
Yes, I was thinking that you might have a plugin already installed, but which doesn't work with vb4. That might be easier since it might only need small changes.
I was about to say that it couldn't be done with template edits and that you probably need a plugin, but that might be wrong: you might be able to edit the postbit_attachment template and do something like: Code:
<vb:if condition="$attachment['attachmentextension'] == 'pgn'"> // applet code from link above here <APPLET archive="Viewer-Deluxe.jar" code="ChessBoard.class" codebase="/bin" width="631" height="560" mayscript="true"> <PARAM name=PgnGameFile value="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&d={vb:raw attachment.dateline}"> <PARAM name=LightSquares value=F3DCC2> <PARAM name=DarkSquares value=DDA37B> <PARAM name=Background value=CCCCCC> <PARAM name=ImagesFolder value=images> <PARAM name=PuzzleMode value="off"> Your browser is completely ignoring the <APPLET> tag! </APPLET> <vb:else /> // existing template code goes here </vb:if> Note that you need to keep the existing template code and make sure it ends up where the comment is. Also, you need to set the codebase= to point to where your Viewer-Deluxe.jar is (unless you actually do have it in a /bin directory). BTW, I haven't tried it so I don't know if this works, but it's the best I can do without actually doing it myself. |
#6
|
||||
|
||||
Thanks for the help guys. It is very much appreciated. I almost have this working, almost. Just need a little more help I think. Okay, the code I have used in the template is this:
Code:
<vb:if condition="$attachment['attachmentextension'] == 'pgn'"> <APPLET archive="Viewer-Deluxe.jar" code="ChessBoard.class" codebase="/httpdocs/pgn" width="631" height="560" mayscript="true"> <PARAM name=PgnGameFile value="/httpdocs/pgn_games/1342828312.pgn"> <PARAM name=LightSquares value=F3DCC2> <PARAM name=DarkSquares value=DDA37B> <PARAM name=Background value=CCCCCC> <PARAM name=ImagesFolder value=images> <PARAM name=PuzzleMode value="off"> Your browser is completely ignoring the <APPLET> tag! </APPLET> <vb:else /> //<li> <img class="inlineimg" src="{vb:stylevar imgdir_attach}/{vb:raw attachment.attachmentextension}.gif" alt="{vb:rawphrase file_type_x, {vb:raw attachment.attachmentextension}}" /> <a href="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&d={vb:raw attachment.dateline}"<vb:if condition="$show['newwindow']"> target="_blank"</vb:if>>{vb:raw attachment.filename}</a> ({vb:raw attachment.filesize}<vb:if condition="$show['views']">, {vb:rawphrase x_views, {vb:raw attachment.counter}}</vb:if>) </li> </vb:if> <PARAM name=PgnGameFile value="/httpdocs/pgn_games/1342828312.pgn"> Now presumably when someone attaches a pgn file, it gets saved in the FTP in this directory: /httpdocs/pgn_games/ And 1342828312 is one of many pgn files saved there. With the above template it displays this particular pgn file, but not the one I tried uploading through Manage Attachments. I tried amending this line of the template to just /httpdocs/pgn_games/ But that didn't work. Any ideas? |
#7
|
|||
|
|||
So what I posted above didn't work? I was hoping that would take the actual attachment path and use that. Remember that the applet runs in the user's browser, so you want that to be the url path and not the path in your server's file system.
Can you link to a post that has a pgn file attached? I poked around you site but couldn't find one. |
#8
|
||||
|
||||
Quote:
Here is one: http://www.ozchess.com.au/showthread...6825#post56825 Its post #2 (there are only 2 posts in this thread). And I tried to use the code you provided but wasn't sure what to do with this: // applet code from link above here so I deleted that, because I think everything you had below this line was the applet code. I think maybe the problem is this. The pgn attachments, everytime one was attached to a post before the upgrade, it would be saved in the FTP in /httpdocs/pgn_games The pgn I attached today did not get saved there. I don't know where in the FTP it would have been saved, but perhaps if all pgn attachments would be saved here, then maybe the code above would work? |
#9
|
|||
|
|||
You were right, that comment can be removed - in html it'll just show up in the output. But anyway, what I meant was the line I had calling attachment.php. I know that doesn't look like a pgn file name, but it should return the pgn file data when called, so it should work like one. In fact, you can see that's just the code copied from the href attribute in the original template.
The uploaded attachments are saved either in the db or the file system. You can go to the attachment manager in the adminCP to see which one you have it set for, and what path they're saved to. I think the normal configuration is to have it set to a path that is not available directly via the web server, because if they were it would bypass the permission system. So that's why attachment.php is used (and also, if attachments are stored in the db that's the only way to get them). Another thought I had - if you copy the original template code and put it above or below the applet code (or remove the <vb:else /> and put the <vb:if> .. </vb:if> around just the applet code), you can display the usual link to download the file as well as the applet. |
#10
|
||||
|
||||
Quote:
/httpdocs/pgn_games/1291890606.pgn Now they are being saved somewhere else. Is there a way where I can find out where that somewhere else is? In the Admin CP > Attachment Storage Type > It says: Code:
Attachments are currently being stored in the database Action Move Items from Database into File System |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|