xoops forums

Forum Index


Board index » All Posts (sarahmx)




sarahmx

Quite a regular
Posted on: 2017/3/8 11:37
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#11

Re: how do is sort select boxes alphabetically in profile module ?

i saw this code in modules/profile/class/field.php
case 'select':
                
$element = new XoopsFormSelect($caption$name$value);
                
// If options do not include an empty element, then add a blank option to prevent any default selection
//                if (!in_array('', array_keys($options))) {
                
if (!array_key_exists(''$options)) {
                    
$element->addOption(''_NONE);

                    
$eltmsg                          = empty($caption) ? sprintf(_FORM_ENTER$name) : sprintf(_FORM_ENTER$caption);
                    
$eltmsg                          str_replace('"''"'stripslashes($eltmsg));
                    
$element->customValidationCode[] = "nvar hasSelected = false; var selectBox = myform.{$name};" "for (i = 0; i < selectBox.options.length; i++) { if (selectBox.options[i].selected == true && selectBox.options[i].value != '') { hasSelected = true; break; } }" "if (!hasSelected) { window.alert("{$eltmsg}"); selectBox.focus(); return false; }";
                }
                
$element->addOptionArray($options);
            
                break;


what do i need to change ?


sarahmx

Quite a regular
Posted on: 2017/3/8 3:09
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#12

Re: how do is sort select boxes alphabetically in profile module ?

Bumping 6 year old thread

Resized Image

anyone ? How do i sort the select box created using the profile module


sarahmx

Quite a regular
Posted on: 2017/3/8 2:58
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#13

Re: extcal database query

noted and tq Bleek


sarahmx

Quite a regular
Posted on: 2017/3/7 6:12
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#14

Re: extcal database query

Thank you zyspec...all now is working



$time time();  
$today=date("d/m/Y"strval($time)); 


global  
$xoopsDB
$sql "SELECT * FROM " $xoopsDB->prefix('extcal_event') . " ";  
if (
$result===false) {  
    die(
$xoopsDB->error());   
}  
$result $xoopsDB->query($sql);  

while(
$row=$xoopsDB->fetchArray($result)) { 
$event_title $row['event_title'];  
$event_start=date("d/m/Y"strval($row["event_start"])); 
$event_end=date("d/m/Y"strval($row["event_end"])); 

//if ((date('d/m/Y', $row['event_start'])) == $today OR (date('d/m/Y', $row['event_end'])) == $today){  

if ($event_start == $today OR $event_end==$today OR $row['event_start'] <= $time && $time <= $row['event_end']){ 
 echo 
$row['event_title'];  
    }  
}


sarahmx

Quite a regular
Posted on: 2017/3/7 4:30
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#15

Re: extcal database query

i tried it something like this but its not working

$time time(); 
$today=date("d/m/Y"strval($time));


global  
$xoopsDB;
$sql "SELECT * FROM " $xoopsDB->prefix('extcal_event') . " "
if (
$result===false) { 
    die(
$xoopsDB->error());  

$result $xoopsDB->query($sql); 

while(
$row=$xoopsDB->fetchArray($result)) {
$event_title $row['event_title']; 
$event_start=date("d/m/Y"strval($row["event_start"]));
$event_end=date("d/m/Y"strval($row["event_end"]));

//if ((date('d/m/Y', $row['event_start'])) == $today OR (date('d/m/Y', $row['event_end'])) == $today){ 

if ($event_start <= $today  && $today <= $event_end){ 
 echo 
$row['event_title']; 
    } 
}


sarahmx

Quite a regular
Posted on: 2017/3/7 1:22
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#16

Re: extcal database query

Thank you its working bleek..i added event_end also

if ((date('d/m/Y'$row['event_start'])) == $today OR (date('d/m/Y'$row['event_end'])) == $today){


but if i have 3 days event

let say 1/3 to 3/3 and today is 2/3 how should i change my code to display the event for 2/3


sarahmx

Quite a regular
Posted on: 2017/3/6 8:49
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#17

extcal database query

Hello XOOPSian

can you help me with this query

i would like to show todays event manually using the query below outside of xoops..currently testing this in localhost inside XOOPS

event_start is stored as integer eg 1306112400

$time time(); 
//echo $time;
$today=date("d/m/Y"strval($time));
//echo $today;

global  $xoopsDB;
$sql "SELECT * FROM " $xoopsDB->prefix('extcal_event') . "  WHERE DATE_FORMAT(event_start, '%d/%m/%Y')='$today' ORDER BY event_start";


The code is not working at the moment, can you guys help me..Please


sarahmx

Quite a regular
Posted on: 2017/3/4 11:46
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#18

Re: Publisher and xoops 2.5.8 tests

Create item with original publisher ok

but Cant create item with cloned publisher

admin/item.php?op=mod

no related debug error..just half load page

Publisher 1.05 Beta
PHP 5.6.29
mySQL 5.6.34


sarahmx

Quite a regular
Posted on: 2016/7/21 3:09
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#19

Re: One block feature I'm missing from older Xoops versions

can core developer comment on this feature.. ?


sarahmx

Quite a regular
Posted on: 2016/7/21 1:29
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#20

mymenus and xbootstrap theme menu

Hi

Im using XOOPS 2.5.8 and mymenus 1.50beta

anyone have skin menu for xbootstrap ?
is it possible to recreate the menu in xbootstrap in mymenus...so i dont have to edit the following file in xbootstrap manually ?


themes/xbootstrap/tpl/nav-menu.tpl
<div class="navbar-wrapper">
    <
div class="navbar navbar-inverse navbar-static-top global-nav">
        <
div class="container">
            <
div class="navbar-header">
                <
button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
                    <
span class="icon-bar"></span>
                    <
span class="icon-bar"></span>
                    <
span class="icon-bar"></span>
                </
button>
                <
a href="<{$xoops_url}>" class="navbar-brand xlogo" title="<{$xoops_sitename}>">
                    <
img src="<{$xoops_imageurl}>images/logo.png" alt="<{$xoops_sitename}>">
                </
a>
            </
div>
            <
div class="navbar-collapse collapse">
                <
ul class="nav navbar-nav">
                    <
li class="active"><a href="<{$xoops_url}>"><{$smarty.const.THEME_HOME}></a></li>
                    <
li><a href="javascript:;"><{$smarty.const.THEME_MODULE1}></a></li>
                    <
li class="dropdown"><a data-toggle="dropdown" class="dropdown-toggle" href="javascript:;"><{$smarty.const.THEME_MODULE2}><b
                                    
class="caret"></b></a>
                        <
ul class="dropdown-menu">
                            <
li><a href="javascript:;">Topic 1</a></li>
                            <
li><a href="javascript:;">Topic 2</a></li>
                            <
li><a href="javascript:;">Topic 3</a></li>
                            <
li><a href="javascript:;">Topic 4</a></li>
                            <
li><a href="javascript:;">Topic 5</a></li>
                        </
ul>
                    </
li>
                    <
li><a href="<{$xoops_url}>/modules/newbb"><{$smarty.const.THEME_MODULE3}></a></li>
                    <
li><a href="<{$xoops_url}>/modules/contact"><{$smarty.const.THEME_MODULE4}></a></li>
                </
ul>
                <
form class="navbar-form navbar-right" role="search" action="<{xoAppUrl search.php}>" method="get">
                    <
div class="form-group">
                        <
input type="text" name="query" class="form-control" placeholder="<{$smarty.const.THEME_SEARCH_TEXT}>">
                        <
input type="hidden" name="action" value="results">
                    </
div>
                    <
button class="btn btn-primary" type="submit"><{$smarty.const.THEME_SEARCH_BUTTON}></button>
                </
form>
            </
div>
        </
div>
    </
div>
</
div><!-- .navbar-wrapper -->



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