SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Mar 20, 2007, 00:57 #1
- Join Date
- Feb 2007
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
[resolved] Need help with coding for generated link
This is my code:
Code:/** * Class declaration */ function ZenpressPopup() { }; /** * Insert an image in the text editor * @param imageId Id of the image (not used yet) * @param imageUrl Filename of the image * @param imageName Name (title) of the image */ ZenpressPopup.prototype.insertImage = function(imageId,imageUrl,imageName) { form = this.getEl('options'); whatValue = this.getRadioValue(form.what); linkValue = this.getRadioValue(form.link); closeValue = this.getRadioValue(form.close); wrapValue = this.getRadioValue(form.wrap); sizeValue = this.getRadioValue(form.size); modRewrite = form.mod_rewrite.value; webPath = form.zp_web_path.value; albumUrl = form.album_url.value; albumName = form.album_name.value; customWidth = form.custom_width.value; customHeight = form.custom_height.value; imageHTML = ""; if (linkValue!="none") { imageHTML += '<a href="'; if (linkValue=="album") { if (modRewrite) { path = webPath+"/"+albumUrl; } else { path = webPath+"/index.php?album="+albumUrl; } imageHTML += path; } else if (linkValue=="custom" && form.link_custom_url.value!="") { imageHTML += form.link_custom_url.value; } else { // "image" is the default if (modRewrite) { path = webPath+"/"+albumUrl+"/"+imageUrl } else { path = webPath+"/index.php?album="+albumUrl+"&image="+imageUrl } imageHTML += path; } imageHTML += '">'; } if (whatValue=="title") { imageHTML += imageName; } else if (whatValue=="custom" && form.what_custom_text.value!="") { imageHTML += form.what_custom_text.value; } else if (whatValue=="album") { imageHTML += albumName; } else { // "thumb" is the default if (modRewrite && sizeValue!="custom") { // ZenPhoto's mod_rewrite does not support custom size! path = webPath+"/"+albumUrl+"/image/"; if (sizeValue!="full") { path += "thumb/" } path += imageUrl } else { path = webPath+"/zen/i.php?a="+albumUrl+"&i="+imageUrl; if (sizeValue!="full" && sizeValue!="custom") { path += "&s=thumb"; } else if (sizeValue=="custom") { path += "&w="+customWidth+"&h="+customHeight; } } imageStyle = ''; imageClass = 'ZenPress_thumb '; if (wrapValue!="none") { imageStyle += 'float:'+wrapValue+'; '; imageClass += 'ZenPress_'+wrapValue+' '; } styleAttr = ''; if (imageStyle!='') { styleAttr = 'style="'+imageStyle+'"'; } imageHTML += '<img class="'+imageClass+'" alt="'+imageName+'" title="'+imageName+'" src="'+path+'" '+styleAttr+' />'; } if (linkValue!="none") { imageHTML += '</a>'; } if(window.tinyMCE) { window.opener.tinyMCE.execCommand("mceInsertContent",true,imageHTML); } else { this.insertAtCursor(window.opener.document.forms["post"].elements["content"],imageHTML); } if (closeValue!="false") { window.close(); } }
Code:<a href="http://www.domain.com/albums/cars/ferrari.jpg">
I tried:
Code:path = webPath+"/albums/"+albumUrl+"/"+imageUrl+" rel="lightbox"
Code:<a href="http://www.domain.com/albums/cars/ferrari.jpg%20rel="lightbox.jpg"">
so it would look like
Code:<a href="http://www.domain.com/albums/cars/ferrari.jpg" rel="lightbox">
Last edited by onetr1p; Mar 20, 2007 at 01:56. Reason: resolved
-
Mar 20, 2007, 03:07 #2
- Join Date
- Nov 2005
- Location
- The Netherlands
- Posts
- 808
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Change this line:
Code:ZenpressPopup.prototype.insertImage = function(imageId,imageUrl,imageName) { form = this.getEl('options'); whatValue = this.getRadioValue(form.what); linkValue = this.getRadioValue(form.link); closeValue = this.getRadioValue(form.close); wrapValue = this.getRadioValue(form.wrap); sizeValue = this.getRadioValue(form.size); modRewrite = form.mod_rewrite.value; webPath = form.zp_web_path.value; albumUrl = form.album_url.value; albumName = form.album_name.value; customWidth = form.custom_width.value; customHeight = form.custom_height.value; imageHTML = ""; if (linkValue!="none") { imageHTML += '<a rel="lightbox" href="';
Bookmarks