Extensions
: K-Meleon Forum
All about K-Meleon extensions.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=mslayer] [quote=JamesD] Guys, I am getting confused. I have the program written to show me the $LinkURL variable from a highlighted link. I don't see the string "?url=" in the $LinkURL from this page. http://www.programurl.com/universal-explorer.htm What I see is "h**p://w**.programurl.com/siteclick.php?a=0&b=1&url=/siteclick.php?a=0&b=1&url=http://w**.spadixbd.com/". I replaced the tt and ww with **. The title for the link is Program Homepage. Did I select the right link? "&url=" shows up more than once in this link. The program so far looks like this. [b]OpenClean.kmm[/b] [code] # K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage) # File name: OpenClean.kmm # ---------- Open link without redirects ---- # # Dependencies : main.kmm # Resources : - # Preferences : - # Version : 0.1 2009-09-21 # Author : JamesD # ------------------------------------------- _OpenCleanlink { alert($LinkURL, "The highlighted link", INFO); setclipboard($LinkURL); #$_OpenCleanPos = index("?url=",$LinkURL); #$_OpenCleanURL = substr( $LinkURL, $_OpenCleanPos +5 ); #alert($_OpenCleanURL, "$_OpenCleanURL DEBUG", INFO); } _OpenClean_BuildMenu { setmenu(LinkSave,macro, "Open Without Redirects",_OpenCleanlink,-1); } $OnInit=$OnInit."_OpenClean_BuildMenu;"; $macroModules=$macroModules."OpenClean;"; [/code][/quote] Hey James, the index() parameters in your code are reversed, I'm trying to fix the code right now, I'm using this: $_OpenCleanPos = index( $LinkURL,"www." ); But I need a [b]while[/b] loop to find the right-most instance of "www." This is what I'm trying to do: [code] $_OpenCleanURL=$LinkURL; while($_OpenCleanPos!=-1){ $_OpenCleanPos = index( $_OpenCleanURL,"www." ); $_OpenCleanPos!=-1?$_OpenCleanURL = substr( $_OpenCleanURL, $_OpenCleanPos ):0; } [/code] I don't know how to use the [b]while[/b] constructor,:( the idea is to find "www." in the string, and then loop and try to find it again. Finally use the last Position of the "www." string, from there extract the link.[/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development
English