31
sarahmx
Re: Help with custom module search.inc.php
  • 2013/4/6 15:38

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


i tried changing
%{$queryarray[0]}%


to
%$queryarray[0]%


still syntax error..



32
sarahmx
Re: Help with custom module search.inc.php
  • 2013/4/6 15:26

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


i got this error

0.000281 SELECT FROM directory_info AND ((name LIKE '%David%' OR department LIKE '%David%' OR unit LIKE '%David%' OR position LIKE '%David%')) ORDER BY name ASC LIMIT 05
Error number
1064
Error message
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ((name LIKE '%David%' OR department LIKE '%David%' OR unit LIKE '%David%' OR p' at line 1



33
sarahmx
Re: Help with custom module search.inc.php
  • 2013/4/6 14:29

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28



search by name, department, unit, position not working no search result found..currently the directory have more than 50+ records

function directory_search($queryarray$andor$limit$offset$userid


    global 
$xoopsDB;

    
$sql "SELECT * FROM " $GLOBALS['xoopsDB']->prefix("directory_info") ."";

    
// because count() returns 1 even if a supplied variable
    // is not an array, we must check if $querryarray is really an array
    
if ( is_array($queryarray) && $count count($queryarray) ) {
        
$sql .= " AND ((name LIKE '%{$queryarray[0]}%' OR department LIKE '%{$queryarray[0]}%' OR unit LIKE '%{$queryarray[0]}%' OR position LIKE '%{$queryarray[0]}%')";
        for ( 
$i=1$i<$count$i++ ) {
            
$sql .= $andor ";
            
$sql .= "(name LIKE '%{$queryarray[$i]}%' OR department LIKE '%{$queryarray[$i]}%' OR unit LIKE '%{$queryarray[$i]}%' OR position LIKE '%{$queryarray[$i]}%')";
        }
        
$sql .= ") ";
    }
    
$sql .= " ORDER BY name ASC";

    
$result $xoopsDB->query($sqlintval($limit), intval($offset));
    
$ret = array();
    
$i 0;
     while(
$myrow $xoopsDB->fetchArray($result)){ 
        
$ret[$i]['image'] = "images/size2.gif"
        
$ret[$i]['link'] = "staff.php?cid=".$myrow['log_id'].""
        
$ret[$i]['title'] = $myrow['name']; 
        
$i++; 
    } 
    return 
$ret
}



34
sarahmx
Re: Help with custom module search.inc.php
  • 2013/4/6 14:05

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


Hye Zyspec...

Thank you for your reply but its not working..no search result is found



35
sarahmx
Help with custom module search.inc.php
  • 2013/4/6 12:49

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


Hi XOOPSers im a php newbie

..i have converted my php simple directory application to xoops module but im stuck with xoops search

i have this search query in my page module... which is working fine

global $xoopsDB;
    
$result "SELECT * FROM ".$xoopsDB->prefix("directory_info")." where name like '%" .  $_POST['search']  .  "%' or department   like '%" .  $_POST['search']  .  "%' or unit like '%" .  $_POST['search']  .  "%'  or position like '%" .  $_POST['search']  .  "%' ORDER BY name";


but now i want to integrate the xoops search (mysite.com/search.php) in my module instead of using own search in my php page

what i did so far

in xoops_version.php

// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
$modversion['search']['func'] = "directory_search";



function directory_search()

{

    global 
$xoopsDB;
    
$result "SELECT * FROM ".$xoopsDB->prefix("directory_info")." where name like '%" .  $_POST['search']  .  "%' or department   like '%" .  $_POST['search']  .  "%' or unit like '%" .  $_POST['search']  .  "%'  or position like '%" .  $_POST['search']  .  "%' ORDER BY name";
    
    
    
    
$ret = array();
    
$i 0;
     while(
$myrow $xoopsDB->fetchArray($result)){
        
$ret[$i]['image'] = "images/size2.gif";
        
$ret[$i]['link'] = "staff.php?cid=".$myrow['log_id']."";
        
$ret[$i]['title'] = $myrow['name'];
        
$i++;
    }
    return 
$ret;

}


can someone help me to correct my code

i just want to be able to search by name, position, department and unit in the xoops search

and the search result to show matching name in the directory

without showing name of submitter (user id)...


sorry for my english



36
sarahmx
Re: Profile 1.62
  • 2012/12/21 14:33

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


https://xoops.org/modules/newbb/viewtopic.php?post_id=347497#forumpost347497

https://xoops.org/modules/newbb/viewtopic.php?post_id=349903#forumpost349903

i think there is Bug with the profile module in 2.5.5 and 2.6

i have the same problem

using the old version of profile from xoops 2.54 Ok


http://sourceforge.net/projects/xoops/files/XOOPS%20Core%20%28stable%20releases%29/XOOPS_2.5.4/


Hope the fix can be applied to xoops 2.5.5 & 2.6 core asap



37
sarahmx
Re: Custom fields with Profile module 1.63 on xoops 2.5.5
  • 2012/11/6 23:58

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


fixed...hope to be applied in the core

https://xoops.org/modules/newbb/viewtopic.php?post_id=347497#forumpost347497



38
sarahmx
how do is sort select boxes alphabetically in profile module ?
  • 2012/11/6 23:55

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28




is this possible how ?



39
sarahmx
Re: Problem with fields in Profile Module
  • 2012/11/6 9:30

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


when i use 1.62 from xoops 2.54 same problem can't delete visibility setting for custom field



40
sarahmx
Re: Custom fields with Profile module 1.63 on xoops 2.5.5
  • 2012/11/6 9:27

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


i figured it out

https://xoops.org/modules/newbb/viewtopic.php?post_id=346232#forumpost346232

there is bug with profile 1.63

using 1.62 from xoops 2.54 all is ok




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



Login

Who's Online

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


Members: 0


Guests: 175


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