|
Chris Maunder wrote:
Hey - nice idea.
Thanks, I try.
Chris Maunder wrote:
but for this I was going to modify the actual message once before storing it.
Well, that would seem to be the way to handle links to me. That is why I thought that a simple client-side JavaScript that does insertions would be cool. No extra work for your servers, and yet it still gets rid of most of the work of inserting a link for the users. And there really isn't any reason not to just store it as is then.
I admit that my idea isn't as transparent to the user as yours is, but I was honestly trying to make it so easy for you to add the feature that you wouldn't be able to resist.
Chris Maunder wrote:
Maybe I should add an option 'InLinkErAte my message' when posting...
Hm, as much as I would like to get my silly kitchen appliance pun out into public view - I think that you should just tie this into the "Display this message as-is" checkbox. If they want HTML then parse for links, if not then don't.
Jason Jystad Cito Technologies Sonork ID: Ogami(100.9918)
There ain't nothin' in this world that's worth being a snot over. --Larry Wall
|
|
|
|
|
Any further activity on this Chris?
I found my notes, they do not help with the above problem but the way I arrived at the solution to what you are doing above was slightly different. I thought I would post it, in case it helps you out or gives you some other ideas.
(ht|f)tps?:\/\/(\w+\.)+\S+
I tested it on your page to verify that it worked, and it seems to do exactly what yours does.
I will think about the above problem some more when I can and see if I can think of a solution for that.
One other thing I should point out is that this will only catch those urls that have an http:// or something in front of them, not the simple www.codeproject.com ones. I think it would be nice to catch these too.
A simple modification to catch URLs without the http:// could go like this:
((ht|f)tps?:\/\/)?(\w+\.)+\S+
Damn, now I have the itch to go write some PERL!!
Jason Jystad Cito Technologies Sonork ID: Ogami(100.9918)
There ain't nothin' in this world that's worth being a snot over. --Larry Wall
|
|
|
|
|
I messed around with it a little bit and it seems that I may have found a solution to your problem. I provided an example in perl, I don't know ASP (I came into this forum because I saw this thread discussed in the lounge).
I basically prefixed your regex with:
(^|.*?[^="'\s])\s*
It works on your example page however with a string like "test http://www.site.com test" it will match the last text before the url as well like so: "test http://www.site.com". This is why I provided the perl example below, to combat this problem. I hope this converts easily to ASP, if not let me know and I will try to think of something else.
$url = 'blah http://www.url1.com/dir/file.txt blah http://www.url2.com/dir/file.txt \'blah\'';
$url =~ s/((^|.*?[^="'\s])\s*)((http|ftp|https):\/\/[\w]+(.[\w]+)([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?)/$1<a href="$3" Target="_BLANK">$3<\/a>"/g;
print "[$url]\n";
It seems to work well, the only problem would be if someone quoted the word directly before the url like "so" http://www.url.com. Anyhow, I hope this helps out.
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
What are my options...?
Are their utility progs that would allow me to update my database sitting on a server...?
Should I use a secure login to only allow admin. certain access and change the contents of the DB...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
What kinda database you have? If it is an Access DB, look at my signature
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I created a web service using VC++ .Net. Then created a simple Web client using ASP .Net. I added a web reference in the WebApplication project to the webservice. But when I try to test the application I get the error listed below. Not sure what I did wrong. Any ideas?
Also if I remove any calls to the Webservice then my asp page works. I believe this may have to do with setting some permission somewhere. But I seem to have done all what the limited documentation asked me to do. So not sure what I am to fix.
Thanks
***********************************************************************
Server Error in '/WebApplication1' Application.
The request failed with HTTP status 401: Access Denied.
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.Net.WebException: The request failed with HTTP status 401: Access Denied.
Source Error:
Line 40: _
Line 41: Public Function HelloWorld() As String
Line 42: Dim results() As Object = Me.Invoke("HelloWorld", New Object(-1) {})
Line 43: Return CType(results(0),String)
Line 44: End Function
Source File: e:\inetpub\wwwroot\WebApplication1\Web References\localhost\Reference.vb Line: 42
Stack Trace:
[WebException: The request failed with HTTP status 401: Access Denied.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
WebApplication1.localhost.Class1.HelloWorld() in e:\inetpub\wwwroot\WebApplication1\Web References\localhost\Reference.vb:42
WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in e:\inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb:34
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
**************************************************************************
|
|
|
|
|
OK. I may have solved this. The MS documentation said that I should disable anonymous access to the web site. If I enable it my web site works. I need to read more to figure this all out.
|
|
|
|
|
I'm tired of beating my head against the wall. I've been playing with styles trying to make a simple page with a header, a left menu pane, and a main display area. It's trivial to do using frames, but I don't want to. I spent the day trying different styles to get a background picture in just the main frame, but I can't make it display anywhere but in the BODY tag. My assumption is that a DIV element can't support a background image, though the CSS-1 spec says the attribute applies to all elements. Scratch idea one.
That's acceptable, but when I add a DIV or SPAN element to contain the menu or main section, it completely blanks out the background in that region, and I can't find an off switch for that 'feature'.
I downloaded the .css file for CP, just to have a real-world example of something that works, and have been studying it this afternoon and evening, but I can't see anything I'm doing wrong from reviewing that source. The cheesy layouts and themes that come with VS are cute, but I wouldn't consider using one for anything real.
Can someone give me a clue how to get this pig started?
|
|
|
|
|
Use tables.
<table>
<tr>
<td colspan="2">
Banner that spans the top of the page
</td>
</tr>
<tr>
<td width="150">Left column (put your menu here)</td>
<td>Right column (put your main content here)</td>
</tr>
</table>
Actually, you can get much fancier than this (take a look at CP's nested tables), but this will give you the basic idea.
Jon Sagara
"Did you bring the butfor?"
"What's a butfor?"
"To poop with, silly."
|
|
|
|
|
I suppose I'll have to, arrggghhhh! I tried that once before, thinking that if I gave a NAME attribute to the central data cell I could direct new data into it from the menu by using the target= attribute, but it didn't work. I guess I'll have to use ASP to change the page and reload each time. Grumble...
Jon Sagara wrote:
"Did you bring the butfor?"
"What's a butfor?"
"To poop with, silly."
Nice one
|
|
|
|
|
Roger Wright wrote:
Nice one
South Park BLU at its finest. It's a variation of another favorite of mine from the movie "Spies Like Us":
"Did you bring the dickfer?"
"What's a dickfer?"
"To pee with."
Jon Sagara
"Did you bring the butfor?"
"What's a butfor?"
"To poop with, silly."
|
|
|
|
|
Jon Sagara wrote:
"Did you bring the dickfer?"
"What's a dickfer?"
"To pee with."
I'm sure I'll find occasion to use both!
|
|
|
|
|
Have you looked into the background-position: x,y; style? Set the background in the body tag with an offset position (equal to the width of your sidebar) and it should work.
cheers,
Chris Maunder
|
|
|
|
|
Interesting thought... I'll give it a try. Thanks!
|
|
|
|
|
I've been programming ASP for some time now.. I like it.
But i've been thinking trying PHP...
What are the advantages with PHP, ASP?
I know that PHP can run on a linux box and i've heard that PHP is faster.. Also, the PHP syntax is more C style, wich I like..
But are there anything that ASP can do better than PHP?
Also, Is it worth the effort to convert my ASP code to PHP ?
Thanks
|
|
|
|
|
Definition: PHP is a simple, object-oriented, interpreted, robust, secure, very high-performance, architecture neutral, portable, dynamic scripting language. PHP has "class" keyword similar to Java's "class" keyword. And PHP is designed such that it is 5 times faster than Java, since there is no virtual machine. PHP is very fast becoming a standard, general purpose, object oriented scripting language. PHP is not only meant for web applications but also can be used for developing general applications.
PHP is a very powerful scripting language. PHP will get rid of PERL/Python and will replace PERL/Python. PHP is the next-generation PERL/Python scripting. PHP can do whatever PERL or Python does and actually does much more, much better and much, much cleaner!! PHP is "mucho" clean.
PHP RUNING IN UNIX, LINUX and WINDOWS.
PHP's strength are :
PHP is the most superior technology. Other technologies PERL, Python, Tcl, VB script, ASP are older and inferior technologies. Even Java/JSP is inferior to PHP.
Open source
Easily learned syntax
Broad database connectivity
Massive library of contributed extensions
General purpose scripting language much superior to PERL, VB script, ASP, JSP.
Fernando Finelli
|
|
|
|
|
at the risk of sounding dumb...
where can i get the php stuff for win2k server and iis (i assume i can use it with iis?)
what version ... where is it ... etc etc ?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Lauren, check out www.zend.com. I recommend these books if you're looking for printed docs:- Core PHP Programming / Leon Atkinson (Prentice-Hall)
- PHP Developer's Cookbook / Sterling Hughes (Sams)
- PHP Pocket Reference / Rasmus Lerdorf (O'Reilly)
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
yes, for IIS,
Download and read the documentation in:
http://www.php.net
http://www.php.net/docs.php
http://www.php.net/do_download.php?download_file=php-4.2.0-Win32.zip
Fernando Finelli
|
|
|
|
|
Just downlaod and run the PHP installer. It will detect the default web servers running and integrate automatically.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
So, PHP is much better than ASP? aint there anything ASP can do better than PHP?
thanks
|
|
|
|
|
Most servers i've checked out cost about twice the price for Windows...
ASP costs more than PHP/Perl would.
You can use COM objects from ASP, I dunno if you can do the same from PHP even running under windows.
Everybody knows Basic...so there's less of a learning curve for learning ASP. Having the ability to use COM is pretty exciting...to me anyways...if you know VC++ and ATL just think of the possibilities...*drool*
Just my opinion though
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Lol, I guess it is an advertisement of PHP?
I didn't find nothing in your words that I can't apply to ASP also, sorry. You sounds like an advertisement guy which sells PHP, lol
ASP running on Windows, Linux and UNIX also.
ASP is simple (in case of VBScript - very simple)
Secure? Are you guaranting 100% security? I don't believe
VBScript is class oriented also (well, kinda, not all options of OOP available). I actually dunno nothing about OOP support in PHP, so I'll better shut up here
....
etc.
Only one thing I can think currently why PHP is better, that PHP script compiled only once (first time executed) and ASP compiling everytime the page requested. Actually never interested if this is right, just heard from someone.
Other ideas?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Oh and forgot one thing... Open source doesn't mean the best. Usually it is otherwise Look at Linux. Fully open source OS... With my respect to programmers, I can't say it is better than Windows.
Using Linux is very non-comfortable.
Programming for Linux can lead to headaches. Documentation couldn't b found easy
Bugs? Well, noone is interested searching bugs in Linux, because who cares?
So the actual answer on question "why everyone is saying that Windows bad and Linux rules" is very simple. Remember guys those DOS days when user calls you everytim he needs to do something, and you feel like God, because you know something that he doesn't know? So some guys still stacked there, and just can't belive they don't rule anymore, that user can simple click "Next->Next->Next" and install a new program. It hurts And this is the answer
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Philip Patrick wrote:
Remember guys those DOS days when user calls you everytim he needs to do something, and you feel like God, because you know something that he doesn't know?
I'd have to dis-agree...
Sure Windows is a push over compared to DOS command prompt, but when peoples computers throw an exception and only show a bunch of hex codes and I explain what "might" have gone wrong and offer a fix via a d/l patch...I still feel like a god.
I think there is more opportunity to feel god like today than back then. There is so much more to go wrong...
I'm a total windows guy...but Win2k hosts cost so much more....it sux...So i've often considered switching to PHP, cuz it'd be cheaper
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|