11
simonvl
Re: Admin for Members List Module
  • 2004/4/11 20:34

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


As you can see, I have been struggling to do just this... can you help me by posting the code somewhere? Did you manage to make the user rank available to the search form?
Would be great if you answered "yes" to these!
Simon



12
simonvl
How to import members from csv list into xoops database
  • 2004/4/11 13:34

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


I have a lot of users to add from a list of users in a text file. If I save these as a .csv file I assume there must be a way to add these to my XOOPS database via my MySQL interface. I don't know the MySQL commands to do this. Can anyone help me? I have user name, email address and rank to import.
Thanks in advance to anyone who knows SQL well enough to give me a simple answer....

Simon



13
simonvl
Re: Error messages from hacking iMenu to get user levels and dynamic sub menus
  • 2004/4/7 14:32

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


Thanks for replying. I have put a .zip package on my website. For some reason mydownloads won't show the file, so you have to use this link:
http://www.tallsimon.com/downloads/simons_iMenu_hack.zip

The bits I had difficulties with are commented out (perhaps not very helpfully documented, sorry its pre-alpha!!)

If you know of any, please suggest alternative ways to display submenu links when a visitor is viewing the main link. Should I use XOOPS [modulehandler]? Get the PATH_INFO or how?

Simon



14
simonvl
PHP function for posting data
  • 2004/4/6 16:40

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


Another possible way could (theoretically) be to post the data to a php page, with then extracted $HTTP_POST_VARS and posted this into a form with the method $GET to the target page. I don't know if there is a way of getting php to do this? Would be very easy if there was.
Simon



15
simonvl
Re: Registering format
  • 2004/4/5 21:42

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


There is also a list of available xoopsform classes at in this article from the french XOOPS site. I found it quite useful for adapting a module..
Simon



16
simonvl
Contact email form for every member: Contact Us small hack with extensive template modification
  • 2004/4/4 11:27

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


I have put a small hack into Contact Us.

I have added a $toEmail value here
extract($HTTP_POST_VARS);
    
$myts =& MyTextSanitizer::getInstance();
    
$toEmail $myts->stripSlashesGPC($toEmail);

and changed the line
$xoopsMailer->setToEmails(function--> admin email)
to     $xoopsMailer->setToEmails($toEmail);


This enables me to send the email address for the contact form through $HTTP_POST_VARS.

I used this with a heavily modified template for userinfo.php which contained a form. The form's toEmail field is a hidden field which contains <input name="toEmail" type="hidden" value="<{$user_email}>" />.

Thus, every member who shows their email address has a contact form... and by deleting the default email field, this is without actually revealing their email address to anyone!

Enjoy.
Simon



17
simonvl
Re: Direct link to search query - xoopsmembers
  • 2004/4/4 10:54

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


Sounds great but left me a bit confused...

Could you list the hacks required?

Do you have to edit these variables multiple times within the document? Think this would be very useful.
Cheers
Simon



18
simonvl
Re: accessing group membership info from Smarty
  • 2004/4/4 8:02

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


Brilliant Dreamgear. Thanks a lot! Just what I was looking for.
Simon



19
simonvl
Re: Formulaire and Anonymous users
  • 2004/3/23 17:21

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


Hi, I just installed it at a web site I am working on. I am wondering if the index page at /modules/formulaire/ is supposed to display a list of available forms or what it is supposed to do. Currently it seems to have Form: and a Submit button.

Also, anonymous posting does not work for me either.
Can anyone enlighten me?
Thanks, Simon



20
simonvl
Error messages from hacking iMenu to get user levels and dynamic sub menus
  • 2004/3/22 21:32

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


I use XOOPS 2.05

I have been adapting iMenu for my purposes, but have come across problems right near the end of my struggles which I cannot seem to fix. I have managed fine to adapt the admin section and the menu to display submenus as you can see at
www.chillout.org.uk.

However, I am having difficulties in making the sub menu items hide properly. I am going for a very simple approach, just basing it on the module rather than a full heirachical database-driven solution.

index.php
<?php

function b_imenu_show($options) {
        global 
$xoopsDB,$xoopsUser;
    
$myts =& MyTextSanitizer::getInstance();
        
$block = array();
    
$group is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
        
$result $xoopsDB->query("SELECT groups, link, submenu, title, target FROM ".$xoopsDB->prefix("imenu")." WHERE hide=0 ORDER BY weight ASC");
    while ( 
$myrow $xoopsDB->fetchArray($result) ) {
        
$title $myts->makeTboxData4Show($myrow["title"]);
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if (
strlen($myrow['title']) >= $options[0]) {
                
$title $myts->makeTboxData4Show(substr($myrow['title'],0,($options[0]-1)))."...";
            }
        }
        
$groups explode(" ",$myrow['groups']);
        if (
count(array_intersect($group,$groups)) > 0) {
            
$imenu['title'] = $title;
            
$imenu['target'] = $myrow['target'];
            
$imenu['link'] = $myrow['link'];
                                                    
$linkaddr explode("/"$imenu['link']);
                                                    
$linkmodule $linkaddr[2];
                                                    
$path getenv('REQUEST_URI');
                                                    
$var1 explode("."$path);
                                                    
$var2 explode("/"$var1[0]); 
                                                    
$presentmodule $var2[2];
                                                
$imenu['submenu'] = $myrow['submenu'];
                                                                       
            if (
eregi("^[([a-z0-9]+)]$"$myrow['link'], $moduledir)) {
                
$module_handler = & xoops_gethandler'module' );
                
$module =& $module_handler->getByDirname($moduledir[1]);
                if ( 
is_object$module ) && $module->getVar'isactive' ) ) {
                    
$imenu['link'] = XOOPS_URL."/modules/".$moduledir[1];
                }
            }
if (
$presentmodule == $linkmodule) {$submenushow "1";
$xoopsTpl->assign('submenushow'$submenushow);}

                    
$block['contents'][] = $imenu;
        }
        }
        return 
$block;
}

function 
b_imenu_edit($options) {
    
$form _IM_IMENU_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[0]."' />&nbsp;"._IM_IMENU_LENGTH."";
    return 
$form;
}
?>


imenu_block.html
<table cellspacing="0">
  <
tr>
    <
td id="mainmenu">
<{
assign var="submenushow" value="0"}>
      <!-- 
start module menu loop -->
      <{foreach 
item=imenu from=$block.contents}>
        <{if ((
$imenu.link != "") AND ($imenu.submenu =="0"))}>
            <
class="menuMain" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}></a>
        <{elseif ((
$imenu.link != "") AND ($imenu.submenu =="1") )}>
            <
class="menuSub" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}></a>
        <{/if}>
      <{/foreach}>
      <!-- 
end module menu loop -->
    </
td>
  </
tr>
</
table>


Basically i picked out the /modulename/ part of the REQUEST_URI and then took the same bit out of the links. Then the idea is that if they are the same, I would make the variable $submenushow = 1 and in the smarty template, I would say <{if $submenushow == 1}> then display the sub menu item, else dont. Simple in concept, but I am not sure if I have done this bit correctly.

The problem arises when I try and use the code
if ($presentmodule == $linkmodule) {$submenushow "1";
$xoopsTpl->assign('submenushow'$submenushow);}


I get:
Quote:
Fatal error: Call to a member function on a non-object in /home/chillout/public_html/modules/iMenu/blocks/imenu.php on line 37


Furthermore, when I use
<{elseif (($imenu.link != "") AND ($imenu.submenu =="1") AND ($submenushow == 1))}>
            <
class="menuSub" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}></a>
I get Quote:
Fatal error: Call to a member function on a non-object in /home/chillout/public_html/modules/iMenu/blocks/imenu.php on line 37


So I think there is an error in my coding in both of these files. Please can someone who is better at PHP help me. Thanks.
(my site may look fine because I have commented these tricky bits out to maintain functionality for now).

Simon




TopTop
« 1 (2) 3 4 »



Login

Who's Online

181 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 181


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