Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Previous versions
 Need a nested forum tag created.
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  20:23:17  Show Profile  Visit dayve's Homepage
I have implemented a script with the help of ruirib that uploads an image and creates a thumbnail. My intentions are to insert the thumbnails into the thread and when clicked, the original image will display. I started to create forum tag called [thumb][/thumb] but it's not coming out the way I want. My primary goal is to have just one forum tag do the function similar to this:

[url="SomeImage.jpg"][img]SomeSmallImage.jpg[/img][/url]



Edited by - dayve on 30 November 2004 10:50:04

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  20:30:18  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
what code do you have so far?

is there a basis for image names? like the thumbnails are thumb_x.jpg vs the actual image being x.jpg?

-Stim

Edited by - Da_Stimulator on 28 November 2004 20:31:05
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  20:39:59  Show Profile  Visit dayve's Homepage
the code I have so far may not make sense and is probably unusable because I will not be able to approach it this way. I'm thinking of just calling the image like so:

[img]image?SomeSamllImage.jpg[/img]

and let the script handle the structure I need.

however, here is what I was initially starting with.
fString = replace(fString, "[thumb]", "<a href=""#"" onClick=""popImage('files/~images/", 1, -1, 1)
fString = replace(fString, "[/thumb]", "','BSF Image Window','middle_center',true,true);return false;"">need to insert image here somehow</a>", 1, -1, 1)


Edited by - dayve on 28 November 2004 20:41:23
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  21:10:59  Show Profile  Visit dayve's Homepage
just for clarification, here is what I am trying to consolidate into one tag:

[url="files/~images/281104060239_10.jpg"][img]files/~thumbs/thumb_281104060239_10.jpg[/img][/url]

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  21:15:29  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I'm bored enough.... lemme play around with the idea for a little bit and I'll get back to ya :)

-Stim
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  21:18:28  Show Profile  Visit dayve's Homepage
and here is a demo thread of the thumbnails that can be clicked, but this is using the combo url and img forum tags as stated earlier.

http://www.burningsoulsforum.com/forum/topic.asp?TOPIC_ID=10917

once this is done, I'll gladly share the code, but you will need to have the .NET Framework on the server that hosts your forum.


Edited by - dayve on 28 November 2004 21:18:42
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  21:38:47  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Okay... did NOT test this at all... cuz I cant really... not sure if it will work, but maybe it will get you headed in the right direction (if it dont work)


Function doThumb(fString)
  Dim filePath, t1Tag, t2Tag, midTags, splitStr, endtLoc
  Dim thumbPath, thumbImg, repString
  filePath = "files/~images/"
  thumbPath = "files/~thumbs/"
  t1Tag = "[thumb]"
  t2Tag = "[/thumb]"
  
  if Instr(fString, t1Tag) and InStr(fString, t2Tag) then
    splitStr = Split(fString, t1Tag)
    For i=0 to Ubound(splitStr)
      endtLoc = InStr(splitStr(i), t2Tag)
      midTags = Left(splitStr(i), endtLoc-1)
      midTags = replace(midTags, filePath, "")
      thumbImg = "thumb_" & midTags
      thumbImg = filePath & thumbImg
      
      repString = "<a href=""#"" onClick=""popImage('" & thumbImg & _
      "','BSF Image Window','middle_center',true,true);return false;"">" & _
      "<img src=""" & thumbPath & midTags & """></a>"
      
      splitStr(i) = replace(splitStr(i), Left(splitStr(i), endtLoc-1), repString)
    Next
    doThumb = Join(splitStr, " ")
    doThumb = replace(doThumb, t1Tag, "")
    doThumb = replace(doThumb, t2Tag, "")
  end if  
End Function

-Stim
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  21:51:06  Show Profile  Visit dayve's Homepage
quickly popped the function in... it wipes out all the information in all the posts. no errors. examining script now.

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  21:59:30  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
hmmm maybe put

else
doThumb = fString


Function doThumb(fString)
  Dim filePath, t1Tag, t2Tag, midTags, splitStr, endtLoc
  Dim thumbPath, thumbImg, repString
  filePath = "files/~images/"
  thumbPath = "files/~thumbs/"
  t1Tag = "[thumb]"
  t2Tag = "[/thumb]"
  
  if Instr(fString, t1Tag) and InStr(fString, t2Tag) then
    splitStr = Split(fString, t1Tag)
    For i=0 to Ubound(splitStr)
      endtLoc = InStr(splitStr(i), t2Tag)
      midTags = Left(splitStr(i), endtLoc-1)
      midTags = replace(midTags, filePath, "")
      thumbImg = "thumb_" & midTags
      thumbImg = filePath & thumbImg
      
      repString = "<a href=""#"" onClick=""popImage('" & thumbImg & _
      "','BSF Image Window','middle_center',true,true);return false;"">" & _
      "<img src=""" & thumbPath & midTags & """></a>"
      
      splitStr(i) = replace(splitStr(i), Left(splitStr(i), endtLoc-1), repString)
    Next
    doThumb = Join(splitStr, " ")
    doThumb = replace(doThumb, t1Tag, "")
    doThumb = replace(doThumb, t2Tag, "")
  else
    doThumb = fString
  end if  
End Function

-Stim
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  22:11:59  Show Profile  Visit dayve's Homepage
well, the posts are no longer blanked out, but the forum tag will not parse:

http://www.burningsoulsforum.com/topic.asp?TOPIC_ID=10917#135138

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  22:13:14  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
..... hrmmmm.... *examines code*

maybe it's because of the split...

add some words and line breaks and stuff and see if it works, multiple references to [thumb] tag... if thats the case then we'll have to fix it...

-Stim

Edited by - Da_Stimulator on 28 November 2004 22:16:46
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  22:21:16  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
obviously not (saw you edited the post)....

its gotta be this line:
if Instr(fString, t1Tag) and InStr(fString, t2Tag) then

because if it wasnt, and it went through the loop, then SOMETHING would have changed. (I would think)

-Stim
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  22:41:12  Show Profile  Visit dayve's Homepage
I commented out the if Instr(fString, t1Tag) and InStr(fString, t2Tag) then and it still did not parse. (yes I also commented out the end if ).

Are you modeling the concept of this script from the ReplaceURLs function?

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  22:43:57  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
no... came up with that from scratch (although the memory of that function was in the back of my head)....

sad that I can remember VBScript functions but not that I left the pizza in the oven.

I just double checked it, I dont see why its not working
..... I'll keep lookin at it and playin with it, see what I come up with.

-edit-
If you commented out the if/end if.... it should have removed the [thumb] tags...


    doThumb = replace(doThumb, t1Tag, "")
    doThumb = replace(doThumb, t2Tag, "")

-Stim

Edited by - Da_Stimulator on 28 November 2004 22:46:23
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 November 2004 :  22:54:09  Show Profile  Visit dayve's Homepage
on a hunch I commented out the on error resume next in the FormatStr function and got this error:

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'Left'

/forum/inc_func_common.asp, line 1283


Line 1283 is:

midTags = Left(splitStr(i), endtLoc-1)

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 28 November 2004 :  22:58:02  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
figures....

I dont know whats wrong with that line...

maybe try Cint(endtLoc-1)

-Stim
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07