Images.mdu upload then return to insert image page

Share your CuteNews.RU skins and code snippets.

Images.mdu upload then return to insert image page

Postby DistantJ » Sat Jul 25, 2009 10:19 pm

Some people (including me) have had a problem with the image insert script going to the image management version of the page after uploading, rather than returning to the insert image version of the page.

I have devised a solution to this using PHP sessions. Here's how to do it!


In images.mdu, at the very top, after:
Code: Select all
<?php
///////////////////////////////////////////////////////////////////
//
//Original images.mdu modified by FI-DD
//http://english.cutenews.ru/forum/profile.php?mode=viewprofile&u=2
//
///////////////////////////////////////////////////////////////////


Add:
Code: Select all
session_start();


Then, find:
Code: Select all
if ($area){
?>


And replace it with:
Code: Select all
if (isset($_SESSION['area'])){
$area=$_SESSION['area'];
}

if ($area){
$_SESSION['area']=$area;
?>


Now, after uploading an image, you will return to where you previously were.

This is a godsend when used with FI-DD's avatar browser mod!
DistantJ
 
Posts: 33
Joined: Tue Jul 29, 2008 10:27 am

Postby eberswine » Fri Nov 13, 2009 8:40 pm

Great HACK!

I was just looking for this!

Works AMAZING!
User avatar
eberswine
 
Posts: 289
Joined: Thu Apr 26, 2007 7:23 pm

Postby DarkSlim » Fri Nov 13, 2009 9:12 pm

Nice! thanks, I'll be checking it tomorrow! :)
I did had some problems with it, after uploading
that is why I also installed the iManager addon
This is great!
User avatar
DarkSlim
 
Posts: 298
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby D72 » Fri Nov 13, 2009 9:51 pm

allthough i've never experienced this problem, you did make a great hack!
nice one. Could it harm my core files when i include this one by default so
it's always there when i install a fresh backend?
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby DarkSlim » Sun Nov 15, 2009 5:47 pm

Hmm for some reason it didn't help much and when uploading/deleting
an image it takes a huge amount of time and then timeouts
Anyone had/has this or know how to fix that? :shock:
User avatar
DarkSlim
 
Posts: 298
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby eberswine » Tue Nov 17, 2009 5:43 am

DarkSlim wrote:Hmm for some reason it didn't help much and when uploading/deleting
an image it takes a huge amount of time and then timeouts
Anyone had/has this or know how to fix that? :shock:


How big is your image that you are uploading.?? I know there is a small timeout issue with default settings!
User avatar
eberswine
 
Posts: 289
Joined: Thu Apr 26, 2007 7:23 pm

Postby DarkSlim » Tue Nov 17, 2009 9:53 am

It's a pretty small image, like 5kb or so, shouldn't be a problem :\
User avatar
DarkSlim
 
Posts: 298
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby samiro » Thu Feb 18, 2010 7:53 pm

its not working for me - after i upload a pic to subfolder.
its go back to the "main" folder

לא עובד, והמבין יבין - אם בכלל
User avatar
samiro
 
Posts: 103
Joined: Sun Apr 20, 2008 1:52 pm
Location: IL


Return to Skins and snippets



Who is online

Users browsing this forum: No registered users and 0 guests

cron