 |
 |
 |
 |
 |
| Author |
Message |
nam

Joined: 23 Dec 2006 Posts: 67
|
|
imagepath preview does not work in addnews page |
|
In the avator field of the addnews page, I always add {imagepath}, but the image preview does not show up the picture. See the attached image to understand my problem:
You may notice the red cross in image preview section.
|
|
| Mon Jul 07, 2008 4:27 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1802 Location: US |
|
|
|
I didn't even know you could use {imagepath} there but don't you need a \ not a /
That probably isn't the answer to the question though I add images a different way.. just noticed no one tried to answer this yet.
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Tue Jul 08, 2008 6:08 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
You can hardcode the image path into skins/cute.js:
 |  | function showpreview(image,name){
if (image != ""){
document.images[name].src = 'here_comes_the_image_path'+image;
} else {
document.images[name].src = "skins/images/blank.gif";
}
} |
After that you only need to add the name of the image, for example pic.jpg.
|
|
| Thu Jul 10, 2008 6:25 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 67
|
|
|
|
 |  | You can hardcode the image path into skins/cute.js:
 |  | function showpreview(image,name){
if (image != ""){
document.images[name].src = 'here_comes_the_image_path'+image;
} else {
document.images[name].src = "skins/images/blank.gif";
}
} |
After that you only need to add the name of the image, for example pic.jpg. |
Thakns dear FI-DD, but this does not work for me. When I hardcode the imagepath, the image preview problem is solved in the addnews page, but the actual Avatar does not show up with the news item on the main web site. It tries to read the image from the main cutenews.ru folder where the avatars are not located.
|
|
| Fri Jul 11, 2008 3:38 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Then you have to additionally hardcode the image path to the {avatar} tag in inc/show.news.php.
|
|
| Fri Jul 18, 2008 9:41 am |
|
 |
nam

Joined: 23 Dec 2006 Posts: 67
|
|
|
|
 |  | Then you have to additionally hardcode the image path to the {avatar} tag in inc/show.news.php. |
Thanks, but this is also not the solution, because If I hardcode the avator tag in the inc/show.news.php, then I have to remove all the {imagepath} tags from the previous posts, otherwise the avatars will not show up.
I was thinking of adding a piece of code in the above function, somthing like:
 |  | function showpreview(image,name){
if (image != ""){
IF image string has "{imagepath}/" in it
do remove it
document.images[name].src = 'data/upimages/'+image;
} else {
document.images[name].src = "skins/images/blank.gif";
}
} |
|
|
| Fri Jul 18, 2008 2:20 pm |
|
 |
nam

Joined: 23 Dec 2006 Posts: 67
|
|
|
|
And finally I found the solution, this code worked well for me:
 |  | function showpreview(image,name){
if (image != ""){
image = image.replace(/\{imagepath\}\//, "");
document.images[name].src = 'data/upimages/'+image;
} else {
document.images[name].src = "skins/images/blank.gif";
}
} |
|
|
| Fri Jul 18, 2008 2:42 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
 |
 |
|