41
Dylian
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/10 0:21

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Yup, my fault i forgot to rename the classnames according to the file names.

If you want to use header and footer.php you should use these files

myreferer/preloads/header.php:
<?php 
defined
('XOOPS_ROOT_PATH') or die('Restricted access');  

class 
myRefererHeaderPreload extends XoopsPreloadItem{  
    function 
eventCoreHeaderStart(){  
        global 
$xoopsDB$xoopsUser
        include(
XOOPS_ROOT_PATH.'/modules/myReferer/record.php'); 
    }  
}  
?>

uservisit/preloads/footer.php:
<?php 
defined
('XOOPS_ROOT_PATH') or die('Restricted access');  

class 
UservisitFooterPreload extends XoopsPreloadItem{  
    function 
eventCoreFooterStart(){  
        include(
XOOPS_ROOT_PATH."/modules/uservisit/index.php"); 
    }  
}  
?>


But you realy don't have to change your files, because renaming them to core.php also works :), i just wanted to post the right code ;).

Greets Dylian.



42
Dylian
Re: XoopsFormHidden
  • 2010/1/5 10:25

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


If you look at the source code in your browser you'll see that the id field does have a value... (a html code lik this generated: <input type="hidden" name="id" value="1234" />

Or is this what you want?
1. user goes to id.php?id=123;
2. user fills in the visible fields;
3. user submits form and goes to send.php?id=123
4. send.php parses the data the user filled in.

If so, use this code:
<?php  

require('mainfile.php'); 
include(
$GLOBALS['xoops']->path('header.php')); 

if(!empty(
$_GET["id"])){ 
    
$id intval($_GET["id"]); 
}elseif(!empty(
$_POST["id"])){ 
    
$id intval($_POST["id"]); 
}else{ 
    
// do something if no id is set 


xoops_load('xoopsformloader'); 

// Added the id to the action url instead of putting it in a hidden field
$form = new XoopsThemeForm(_MI_SEND"form1""send.php?id=".$id);
//$hidden_id = new XoopsFormHidden('id', $id); 
//$form->addElement($hidden_id); 

$button_submit = new XoopsFormButton("""submit"_MI_SENDNOW"submit");  
$form->addElement($button_submit);  

$form->display(); // OR
//$xoopsTpl->assign('form', $form->display()); 


include($GLOBALS['xoops']->path('footer.php')); 
?>


Greets Dylian.



43
Dylian
Re: XoopsFormHidden
  • 2010/1/5 1:05

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Don't really get what your trying to do, but this is the working version of the script you posted above.

(I removed the template vars as they ain't needed for proper functioning of the script)

Version 1:
<?php 

require('mainfile.php');
include(
$GLOBALS['xoops']->path('header.php'));

if(!empty(
$_GET["id"])){
    
$id intval($_GET["id"]);
}elseif(!empty(
$_POST["id"])){
    
$id intval($_POST["id"]);
}else{
    
// do something if no id is set
}

xoops_load('xoopsformloader');

$form = new XoopsThemeForm(_MI_SEND"form1""send.php"); 

$hidden_id = new XoopsFormHidden('id'$id);
$form->addElement($hidden_id);

$button_submit = new XoopsFormButton("""submit"_MI_SENDNOW"submit"); 
$form->addElement($button_submit); 

$form->display();


include(
$GLOBALS['xoops']->path('footer.php'));
?>


This version puts the form in the <{$form}> template var (If you realy wan't to work with templates )

Version 2:
<?php 

require('mainfile.php');
include(
$GLOBALS['xoops']->path('header.php'));

if(!empty(
$_GET["id"])){
    
$id intval($_GET["id"]);
}elseif(!empty(
$_POST["id"])){
    
$id intval($_POST["id"]);
}else{
    
// do something if no id is set
}

xoops_load('xoopsformloader');

$form = new XoopsThemeForm(_MI_SEND"form1""send.php"); 

$hidden_id = new XoopsFormHidden('id'$id);
$form->addElement($hidden_id);

$button_submit = new XoopsFormButton("""submit"_MI_SENDNOW"submit"); 
$form->addElement($button_submit); 

$xoopsTpl->assign('form'$form->display()); 


include(
$GLOBALS['xoops']->path('footer.php'));
?>


Hope this does what you want it to do and otherwise please try to explain what your trying to do...

Greets Dylian.



44
Dylian
Re: XoopsCache class.
  • 2010/1/5 0:34

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Try this one, this way you'll immediately see if MEMCACHE is even available on your server.

<?php 
require(../'mainfile.php');

include(
$GLOBALS['xoops']->path('header.php'));

if (
class_exists('Memcache')) {
    echo 
'<span style="color: green; font-weight: bold; font-size: 12px;">The Memcache class is available</span><br />';
}else{
    echo 
'<span style="color: red; font-weight: bold; font-size: 14px;">The Memcache class is not available</span><br />';
}

xoops_load('xoopscache'); 
$cache XoopsCache::getInstance(); 
if(
$cache->engine('memcache')){
    
$val 'val'
    
$key 'test'
    
$cache->write($key$val100); 
    
$ret $cache->read($key); 
    echo 
$ret
}else{
    echo 
'<span style="color: blue; font-weight: bold; font-size: 12px;">MEMCACHE Could not be loaded</span>';
}

include(
$GLOBALS['xoops']->path('footer.php'));
?>
(Just a modified version of your original script)

Greets Dylian.



45
Dylian
Re: liaise/xforms - custom field as email title ?
  • 2010/1/2 13:53

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Ok, this is harder to do then i thought, i'll definitly add it to xForms but as i'm not familiar with the code of liaise (/xforms) it may take some time...

If someone knows how to add it please report, then i'll add it to xForms.

In the meanwhile i'll keep trying myself to, hoping i'll find a way to do it.

Greets Dylian



46
Dylian
Re: liaise/xforms - custom field as email title ?
  • 2010/1/2 9:58

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Nice idea, i'll add this to xForms for sure. I'll post the hack here as soon as i can .

Greets Dylian.

BTW I'm hoping to release the final/rtu version of xforms this month, as the release has been delayed for a long time.



47
Dylian
Re: myreferer & uservisit module with preloads xoops 2.4?
  • 2010/1/1 18:01

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


For myReferer create a file in myreferer/preloads/ named header.php (or something else, just what you like...)

And put this in it:
<?php
defined
('XOOPS_ROOT_PATH') or die('Restricted access'); 

class 
myRefererCorePreload extends XoopsPreloadItem
    function 
eventCoreHeaderStart(){ 
        global 
$xoopsDB$xoopsUser;
        include(
XOOPS_ROOT_PATH.'/modules/myReferer/record.php');
    } 

?>


And for uservisit create a file in uservisit/preloads/ named footer.php (or something else ofcourse)

And put this in it:
<?php
defined
('XOOPS_ROOT_PATH') or die('Restricted access'); 

class 
UservisitCorePreload extends XoopsPreloadItem
    function 
eventCoreFooterStart(){ 
        include(
XOOPS_ROOT_PATH."/modules/uservisit/index.php");
    } 

?>


Greets Dylian.



48
Dylian
Re: Preloads stop working in XOOPS 2.4.3
  • 2010/1/1 14:37

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Oops, forgot to update the system module.

Problem solved... (Me and my stupid brain )

Greets Dylian.



49
Dylian
Preloads stop working in XOOPS 2.4.3
  • 2010/1/1 13:54

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


I had a couple of preloads running on my website including the one included in the latest xlanguage. But all of them stopped working after i upgraded to x2.4.3.

How can i solve this?

Greets Dylian

BTW To see what i mean you can go tohttp://www.dylian.eu and login with the username test and the password testit.



50
Dylian
Re: Why imgcat_type = 'C'
  • 2009/12/30 20:06

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


I think C stands for CUSTOM category. Because it's not possible to delete a category where the type is set to C.

Don't know for sure but that's all i can see from te code.

from line 92:
if (in_array(XOOPS_GROUP_ADMIN$groups)) {
    echo 
' [<a href="admin.php?fct=images&op=editcat&imgcat_id='.$imagecategorys[$i]->getVar('imgcat_id').'">'._EDIT.'</a>]';
   if (
$imagecategorys[$i]->getVar('imgcat_type') == 'C') {
        echo 
' [<a href="admin.php?fct=images&op=delcat&imgcat_id='.$imagecategorys[$i]->getVar('imgcat_id').'">'._DELETE.'</a>]';
    }
}


from line 515:
if ($imagecategory->getVar('imgcat_type') != 'C') {
    
xoops_cp_header();
    
xoops_error(_MD_SCATDELNG);
    
xoops_cp_footer();
    exit();
}

Hope you can sleep now

Greets Dylian.

BTW Please mention the file you refer to the next time, it did take a time to figure out it was in modules\system\admin\images\main.php .




TopTop
« 1 2 3 4 (5) 6 7 8 ... 11 »



Login

Who's Online

148 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 148


more...

Donat-O-Meter

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

Latest GitHub Commits