This thread is a discussion for the wiki article: TinyMCE and ExpressionEngine Integrated File Upload Management
   
 
TinyMCE and ExpressionEngine Integrated File Upload Management
Posted: 19 August 2008 10:32 PM   [ Ignore ]  
Summer Student
Total Posts:  8
Joined  06-22-2008

Thanks! This looks like what I need. A question though, how does the nested-source part fit in. I cannot see any embed statements in the main template?

Profile
 
 
Posted: 03 November 2008 06:10 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  61
Joined  01-23-2006

Anyone know how the nested-source fits into this?

 Signature 

Vibe9 Design - Vancouver Web Design Company

Profile
 
 
Posted: 03 November 2008 06:47 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  8
Joined  06-22-2008

hey vibe9, I just hard coded the path variables and it worked fine.

tmce_imagelist.js

<?php

print “var tinyMCEImageList = new Array(”;

$imagepath = “/images/assets/”;

$d= “/home/example/public_html/images/assets/”;

$dir = opendir($d); #open directory
while ($f = readdir($dir))
{
if (eregi(”\.jpg”,$f) OR eregi(”\.gif”,$f))
{
print “[\”$imagepath$f\”, \”$imagepath$f\”],”;
}
}
closedir($dir);

print “[\”\”,\”\”]);”;
?>

Profile
 
 
Posted: 03 November 2008 07:09 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  61
Joined  01-23-2006

That works great. Thanks Hinterlands!

 Signature 

Vibe9 Design - Vancouver Web Design Company

Profile
 
 
Posted: 05 November 2008 03:21 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  149
Joined  09-01-2006

Hi,

Can anyone tell me where am I creating this nested-query source file? Am I creating it in the same imagelist.js file or somewhere else? Also is the imagelist.js supposed to be a javascript file or a web file? If web file, why confuse everyone by giving it the extension .js?

I cannot hard code it as I have multiple file upload locations… unless I still don’t understand what I am doing here, won’t be the first time.

Help!!!

Socaprice

Profile
 
 
Posted: 05 November 2008 08:16 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  8
Joined  06-22-2008

The code snippet should be created in EE as a web page template ( I don’t think javascript templates are parsed ). EE doesn’t care about the extension of the template afaik. You can add additional directories but you would need to modify the code to loop over multiple server_path variables.

Profile
 
 
Posted: 06 November 2008 08:31 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  149
Joined  09-01-2006

Thanks, however you have hard coded the nested-query into the main code that does me no good as I have many different blogs that need to remain separate. I therefore cannot hard code that particular code, so I will still need to know where to place the nested-query code if not in the same imagelist.js file.

Thanks for the help though.

Socaprice

Profile
 
 
Posted: 14 November 2008 12:59 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  06-27-2008
socaprice - 06 November 2008 08:31 AM

Thanks, however you have hard coded the nested-query into the main code that does me no good as I have many different blogs that need to remain separate. I therefore cannot hard code that particular code, so I will still need to know where to place the nested-query code if not in the same imagelist.js file.

Thanks for the help though.

Socaprice

Hi, I’m running into the same troubles!
anyone found out on where to put that nested query?

cheers
stefan

Profile
 
 
Posted: 14 November 2008 05:58 PM   [ Ignore ]   [ # 8 ]  
Summer Student
Total Posts:  8
Joined  06-22-2008

Hey - if you look at both source snippets included you’ll notice they are pretty much the same, apart from the SQL at the top. You use imagelist.js if you want to ONLY list files that your members have access to upload to. You can use just the nested-query to show ALL files from ALL upload directories. I think the author intended for the nested-query to be embedded within the no_results block.

“The second part checks to see if there were no results, this means that either an admin is posting or the current user is allowed to access all upload paths, and if so then we just need to get all the “server_paths” from table “exp_upload_prefs”, thus the entire reason for the nested query.”

Profile
 
 
   
 
 
‹‹ Ajax search      Recurring entries ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64935 Total Logged-in Users: 56
Total Topics: 81900 Total Anonymous Users: 26
Total Replies: 440276 Total Guests: 272
Total Posts: 522176    
Members ( View Memberlist )