I tried to find a solution by myself. I was able to create an icon that allows you to upload to photoshare from your pagesetter wyswyg editor (HTMLAREA). But I would like that the HTML code for displaying the uploaded picture is inserted automatically in the text after a sucessful upload.I was not able to do that. I am not very familiar with java script, and hope someone can help me with that.
Here is the code I have written so far:
ENTER this code in pagesetter/guppy/guppy.js right after
config.toolbar[config.toolbar.length-1].push("pagebreak");
near line 440
config.registerButton({
id : "uploadbutton",
tooltip : "upload images",
image : "images/smilies/icon14.gif",
textMode: false,
action:
function(editor, id)
{
if (typeof photoshareFindImage == "undefined")
alert("You have apparently not installed the Photoshare image gallery");
else
{
// Check for base URL which is used to make this run in fullscreen mode
url = (typeof postnukeBaseURL == "undefined" ? "" : postnukeBaseURL+"/" /* defined by html output */);
url += "index.php?module=photoshare&func=uploadimage&url=absolute&html=img&targetID=" + textareaID;
photoshareFindImageHtmlArea30(editor, url, photoshareThumbnailSize /* defined by html output */);
}
}
});
config.toolbar[config.toolbar.length-1].push("uploadbutton");
Then enter the functions photoshare_user_uploadimage() and photoshare_user_uploadimages2() in photoshare/pnuser.php.
The code of these two functions is as follows:
// -----------------------------------------------------------------------
// Upload image and store in opening window's input element
// -----------------------------------------------------------------------
function photoshare_user_uploadimage()
{
// Check access
if (!photoshareAccessFolder(-1, photoshareAccessRequirementView, ''))
return photoshareErrorPage(__FILE__, __LINE__, _PSNOAUTH);
if (!pnModAPILoad('photoshare', 'user'))
return photoshareErrorPage(__FILE__, __LINE__, _PSAPILOADFAILED);
$user = pnUserGetVar('uid');
$targetInputID = pnVarCleanFromInput('targetID');
$resultURLFormat = pnVarCleanFromInput('url');
$resultHTMLFormat = pnVarCleanFromInput('html');
$targetMode = pnVarCleanFromInput('target');
$folders = pnModAPIFunc('photoshare',
'user',
'get_accessible_folders',
array('user' => $user,
'getForList' => false) );
if ($folders === false)
return photoshareErrorAPIGet();
$theme = pnVarPrepForOS(pnUserGetTheme());
problems: one is the message i read on the photoshare module page as acessed from the menu;
[b]Error in API: "get_accessible_folders" failed: Table 'dragon_messyworld.nuke_photoshare_folders' doesn't exist while executing: SELECT nuke_photoshare_folders.ps_id, nuke_photoshare_folders.ps_title
:
http://localhost/postnuke/index.php?module=photoshare
and this is what appear on the page :
Error in API: "get_accessible_folders" failed: Table 'Phoenix.nuke_photoshare_folders' doesn't exist while executing: SELECT nuke_photoshare_folders.ps_id, nuke_photoshare_folders.ps_title
server (PN 0.721). Everything works just fine locally, though (Windows, PN ver. 0.723):
Error in API: "get_accessible_folders" failed: Unknown column 'nuke_photoshare_folders.ps_blockfromlist' in 'where clause' while executing: SELECT nuke_photoshare_folders.ps_id, nuke_photoshare_folders.ps_title FROM nuke_photoshare_folders LEFT JOIN nuke_photoshare_access ON nuke_photoshare_folders.ps_id = nuke_photoshare_access.ps_folder LEFT JOIN nuke_group_membership ON nuke_photoshare_access.ps_kind = 0 AND nuke_group_membership.pn_uid = 2 LEFT JOIN nuke_users ON nuke_photoshare_folders.ps_owner = nuke_users.pn_uid WHERE (nuke_photoshare_folders.ps_owner = 2 OR nuke_photoshare_folders.ps_accesslevel = 1 OR nuke_photoshare_folders.ps_accesslevel = 2 OR nuke_photoshare_access.ps_access >= 0 AND nuke_photoshare_access.ps_kind = 1 AND nuke_photoshare_access.ps_id = 2 OR nuke_photoshare_access.ps_access >= 0 AND nuke_photoshare_access.ps_kind = 0 AND nuke_group_membership.pn_uid = 2 AND nuke_group_membership.pn_gid = nuke_photoshare_access.ps_id