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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Mod-Utility Request Embed External Images locally
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 February 2010 :  14:51:29  Show Profile  Visit HuwR's Homepage  Reply with Quote
one more question, should have asked before, do you want to store them in directories using the username or id ?
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 21 February 2010 :  15:03:59  Show Profile  Visit Todd's Homepage  Reply with Quote
Username please, that's how it's been done since I put the forums up.

The webpath to my forum files is http://www.tycoforums.com/tyco/forum

The webpath to an image I upload using the filea attachment mod would end up being http://www.tycoforums.com/tyco/forum/uploaded/MYUSERNAME/MYUPLOADEDIMAGE.JPG


Admin for the Tyco Collector's Forum

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 February 2010 :  15:28:17  Show Profile  Visit HuwR's Homepage  Reply with Quote
ok great, I have done it so that the upload root is read from a config file, so you would put /tyco/forum/uploaded/ in the config file.

I think I have it pretty much ready to go, but won't get chance to upload it today, got to nip out for a few hours but will upload the code with some instructions for you tomorrow.
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 21 February 2010 :  15:42:31  Show Profile  Visit Todd's Homepage  Reply with Quote
quote:
Originally posted by HuwR

ok great, I have done it so that the upload root is read from a config file, so you would put /tyco/forum/uploaded/ in the config file.

I think I have it pretty much ready to go, but won't get chance to upload it today, got to nip out for a few hours but will upload the code with some instructions for you tomorrow.



Thank you very much, it's appreciated.


Admin for the Tyco Collector's Forum

Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 21 February 2010 :  17:42:00  Show Profile  Visit Todd's Homepage  Reply with Quote
Not sure if you considered the following in your code.

What happens if a poster replies to a topic with a quote (reply with quote) and that quoted material includes an image from the original post?

I don't think we would want to capture that image also and put it into the responder's upload folder. We would however want to capture all images outside the quoted picture, maybe even if the target image outside the forum is the same.

Thoughts?


Admin for the Tyco Collector's Forum


Edited by - Todd on 21 February 2010 17:43:59
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 February 2010 :  02:04:37  Show Profile  Visit HuwR's Homepage  Reply with Quote
not a great deal I can do about that, the code just grabs [img] tags and replaces the content if it is an external link to do something different if it is wrapped in a quote would make the code virtually un-runable (it would just time out) unless you did it topic by topic, there are too many images to try and keep track of every url it replaces, if it were a desktop app it would be different but you are limited to what you can do with web.
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 22 February 2010 :  11:45:23  Show Profile  Visit Todd's Homepage  Reply with Quote
quote:
Originally posted by HuwR

not a great deal I can do about that, the code just grabs [img] tags and replaces the content if it is an external link to do something different if it is wrapped in a quote would make the code virtually un-runable (it would just time out) unless you did it topic by topic, there are too many images to try and keep track of every url it replaces, if it were a desktop app it would be different but you are limited to what you can do with web.



I'm sure you're right, plus I'll have backups of some of the images. Actually, no, it's going to parse the urls, do it's job and mark that url as being taken care of. In most cases it wouldn't hit a quoted image that hasn't been taken care of already assuming most quoted images are likely to be in the same topic. Is that how it progresses through a topic? Re-reading your explanation above, maybe not.

Please realize I'm only trying to understand how things work and you're a great one to learn from.

What you have mentioned it will do is going to be awesome! I've already notified my forum members that I would be doing something with the forums and they might notice some sluggishness.


Admin for the Tyco Collector's Forum


Edited by - Todd on 22 February 2010 11:49:26
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 February 2010 :  12:54:10  Show Profile  Visit HuwR's Homepage  Reply with Quote
no, it only tracks missing images (since they are the ones that generally take the longest to get a response from) images it finds it just downloads and replaces the img tag with a local reference, it does not keep track of them, obviously it could do things a lot better, but only if you don't mind waiting a few weeks for me to write the code

it grabs the image tags by doing some regex matches on the message, it doesn't check anything other than image tags so does not know if it is within a quote tag or not. Like I said, it could be done, but it is a lot more coding and a lot more time.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 February 2010 :  13:19:40  Show Profile  Visit HuwR's Homepage  Reply with Quote
Ignore last post, I think I just had a brain wave, just doing some quick testing.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 February 2010 :  03:21:12  Show Profile  Visit HuwR's Homepage  Reply with Quote
OK , here goes.
If you need any help with any of this just drop me an email.

You need to do the following.
1) In your website you need to create an application directory for .net 2
Say something like imagegrab, so it's url would be http://www.tycoforums.com/imagegrab
2) in the zip you will find a file called web.config, open it in notepad and adjust any of the setting that need tweaking (i think they should be ok apart from the connection string which will need pointing at your database)
3)upload the files in the zip to the newly created app directory
4) open the default.aspx page in your browser and off you go.

I tested it on a copy of this database, it ran through the whole forum without an issue, but then I was running it locally so it had nothing to contend with.

files for download Image Grabber
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 23 February 2010 :  17:03:55  Show Profile  Visit Todd's Homepage  Reply with Quote
quote:
Originally posted by HuwR

OK , here goes.
If you need any help with any of this just drop me an email.

You need to do the following.
1) In your website you need to create an application directory for .net 2
Say something like imagegrab, so it's url would be http://www.tycoforums.com/imagegrab
2) in the zip you will find a file called web.config, open it in notepad and adjust any of the setting that need tweaking (i think they should be ok apart from the connection string which will need pointing at your database)
3)upload the files in the zip to the newly created app directory
4) open the default.aspx page in your browser and off you go.

I tested it on a copy of this database, it ran through the whole forum without an issue, but then I was running it locally so it had nothing to contend with.

files for download Image Grabber




I made a folder in the wwwroot called imagegrab and copied your files into it. Went into IIS and created application directory for it. Set to ASP.NET 2.0 and changed the path to database starting at C:\Intetpub\etc\etc\etc\etc\databasefile I also used a relative webpath such as /tyco/fo..../databasefile

Went to open the default.aspx of the application and got this. Might the bolded part be the cause?


Server Error in '/imagegrab' Application.
--------------------------------------------------------------------------------

Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported: 'provider'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentException: Keyword not supported: 'provider'.]
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +4907604
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +24
SnitzImageGrab.DataAccess.GetForumList() in D:\Development\SnitzImageGrab\SnitzImageGrab\App_Code\DataAccess.cs:20
SnitzImageGrab._Default.BindForumList() in D:\Development\SnitzImageGrab\SnitzImageGrab\Default.aspx.cs:27
SnitzImageGrab._Default.Page_Load(Object sender, EventArgs e) in D:\Development\SnitzImageGrab\SnitzImageGrab\Default.aspx.cs:20

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082


Admin for the Tyco Collector's Forum


Edited by - Todd on 23 February 2010 17:14:32
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 February 2010 :  17:14:39  Show Profile  Visit HuwR's Homepage  Reply with Quote
it doesn't like the connection string, since I don't use access I have no ide what it should be, that was taken from a website, you will have to do some goggle searches to find out what the correct connection string should be
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 February 2010 :  17:23:01  Show Profile  Visit HuwR's Homepage  Reply with Quote
seems a lot of people are having this issue, I will see if I can figure it out
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 23 February 2010 :  17:32:33  Show Profile  Visit Todd's Homepage  Reply with Quote
thanks. I do think I've put in the right path. It looks as if something you've hardcoded is pointing to your D: Drive, possibly from when you were developing and testing?


Admin for the Tyco Collector's Forum

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 February 2010 :  17:41:52  Show Profile  Visit HuwR's Homepage  Reply with Quote
ok, new code coming in a few minutes, figured out what I did wrong, it is nothing to do with the path, the d: is from the debug file and is just showing where in the code the error is occuring
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 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