11
spiff
Re: Add javascript code in ...
  • 2005/3/22 17:05

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


I didn't see a workaround for this, but would like to implement a mechanism that would allow some flexibility in the Control Panel's HEAD tags. I've posted a suggestion to this thread to try to provide a solution.

See you there
-e



12
spiff
Re: javascript in admin head tags
  • 2005/3/22 17:01

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


I'm just now facing an issue related to this.

When you're developing a module for everyone's use and wish to include JavaScript in the HEAD, you don't want to make a change to the admin file itself.

I'm having a very long process to handle and wish to display a progress bar without page refresh, and hence am using JavaScript to do so.

In 2.0.9.2, xoops_cp_header() essentially hard-codes the HEAD data. I think the ability to add a JavaScript file in the HEAD would be useful, that would permit calls such as:

xoops_cp_header(); // For default
xoops_cp_header('/modulename/file.js'); // Adds a file
xoops_cp_header(array('/modulename/file1.js','/modulename/file2.js')); // Includes two, etc. files

This would make it possible to make modules more portable when they have to rely on some JavaScript operation.

Comments?
Eric



13
spiff
Re: Meta, trackbacks, Gutters
  • 2005/1/21 17:54

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


There's some discussion on trackback here.

In case you haven't found how to include your external counter yet: you need to create a block in the admin section, paste the code in it, then make it visible to the desired groups.



14
spiff
Re: TrackBack Standalone
  • 2005/1/21 17:51

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


Darn.

This is invaluable, and is a must for CMS to get proper traction. If I get a little free time, I'd be willing to take over from what you have. Has all your work in progress on this subject been posted here? I went over to dev.xoops.org, but there's nothing on ping/trackbacks available...

I'm checking out the trackback module now. Have you tried it?

Eric



15
spiff
Re: Cache of 26 MB
  • 2005/1/17 18:39

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


I have a question regarding the cache.

When I set a module cache from some time value back to zero (to have a specific change appear immediately). There seems to be a delay of a few minutes during which it is impossible for me to access the site (although I can still access the admin section). What do you suppose accounts for that? Does the entire cache get recreated for all modules when a change is made, or only that of the changed module?

Thanks,
Eric



16
spiff
Re: Drag & Drop Contents Editing
  • 2005/1/16 18:11

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


Not precisely what you meant, but you may be interested in WordPress-style PressIt functionality for mylinks.



17
spiff
Re: AutoLinks and AutoAcronym
  • 2005/1/16 18:08

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


I vote for that!

The module could have an admin section to enter specific terms that should be replaced with URLs or Glossary terms. Rather than forcefully replacing content in the database, it could replace content on-the-fly (that's what happens with urls and emails already, which are all parsed and rendered in makeClickable() in /class/module.textsanitizer.php).



18
spiff
Press It (WordPress-style hack) for mylinks
  • 2005/1/16 17:49

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


I spend a fair amount of time building the links database, and find myself regularly cutting and pasting between browser tabs (thank you Firefox) from a cool page to the XOOPS "new link" admin form.

I thought it would be useful if I'd be able to select some text off a page, then have a javascript link paste the page url, title and selected text into the link form.

I looked at the WordPress example, and modified it to do something like this (line breaks inserted for readability, in reality the entire code below needs to fit in one line starting with js without the spaces, and be saved as a bookmark in your browser):
j a v a s c r i p t:if(navigator.userAgent.indexOf('Safari' >= 0){
  
Q=getSelection();
}else{
  
Q=document.selection
    
?document.selection.createRange().text
    
:window.getSelection();
}
void(window.open(
  
'http://my.xoops.site/modules/mylinks/index.php'
    
+'?op=linksConfigMenu'
    
+'&popuptext='+escape(Q)
    +
'&popupurl='+escape(location.href)
    +
'&popuptitle='+escape(document.title),
  
'xoops bookmarklet',
  
'scrollbars=yes,
  width=600,
  height=460,
  left=100,
  top=150,
  status=yes'
));

Passing data into the forms in file /modules/mylinks/admin/index.php (function linksConfigMenu) is just a matter of replacing (around line 185):
echo "<input type=text name=title size=50 maxlength=100>";
echo 
"</td></tr><tr><td align="right" nowrap>"._MD_SITEURL."</td><td>";
echo 
"<input type=text name=url size=50 maxlength=250 value="http://">";
echo "</td></tr>";
echo 
"<tr><td align="right" nowrap>"._MD_CATEGORYC."</td><td>";
$mytree->makeMySelBox("title""title");
echo 
"<tr><td align="right" valign="top" nowrap>"._MD_DESCRIPTIONC."</td><td>n";
xoopsCodeTarea("description",60,8);
with:
echo "<input type=text name=title size=50 maxlength=100 value=".$_GET['popuptitle'].">"/* CHANGE */
echo "</td></tr><tr><td align="right" nowrap>"._MD_SITEURL."</td><td>";
echo 
"<input type=text name=url size=50 maxlength=250 value="".$_GET['popupurl']."">"/* CHANGE */
echo "</td></tr>";
echo 
"<tr><td align="right" nowrap>"._MD_CATEGORYC."</td><td>";
$mytree->makeMySelBox("title""title");
echo 
"<tr><td align="right" valign="top" nowrap>"._MD_DESCRIPTIONC."</td><td>n";
xoopsCodeTarea("description",60,8,null,stripslashes($_GET['popuptext'])); /* CHANGE */

Passing the selected text involves modifying file /include/xoopscode.php, adding a $textarea_content parameter:
function xoopsCodeTarea($textarea_id$cols=60$rows=15$suffix=null$textarea_content='')
then replacing (around line 72):
$areacontent = isset( $GLOBALS[$textarea_id] ) ? $GLOBALS[$textarea_id] : '';
with:
$areacontent = isset( $GLOBALS[$textarea_id] ) ? $GLOBALS[$textarea_id] : $textarea_content;

Presumably, no one would even be able to access the admin add/modify links page without having signed in with proper admin credentials, but I would appreciate if you'd put in your 2 cents and let me know whether the above hack introduces vulnerability.

Thanks,
Eric

P.S. Code wasn't tested under Safari.



19
spiff
Re: Protector installation & Headlines module
  • 2005/1/13 0:13

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


Thanks, Dave.

Well, then do you think modifying httpd.conf to include the xoopsheadlines module might work as a quick solution?
<Directory "/home/user/htdocs/public_html/modules/xoopsheadline">
php_admin_flag allow_url_fopen on
</Directory>

From looking at the docs, I doubt fsockopen() would behave differently than file() when the allow_url_fopen flag is off...

[Edit: mentioned httpd.conf for clarity]



20
spiff
Re: Protector installation & Headlines module
  • 2005/1/12 21:08

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


In essence, all that would be needed would be to start the PHP code in file /modules/xoopsheadline/class/headlinerenderer.php with the line:
ini_set("allow_url_fopen""1");

If the code is written well enough below that (i.e. makes sure there's no tampering possible with the list of feed urls fed into the file() method), that should be the only change necessary.




TopTop
« 1 (2) 3 4 5 »



Login

Who's Online

180 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 180


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits