21
zite83
MySQL and quotes
  • 2006/9/27 19:57

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


I understand that quotes can stop a MySQL statment. I was wondering whats the propper way to get arround this issue.

Lets say I have this
$variable"The boat's color is red" ;

$Query "INSERT INTO ".$xoopsDB->prefix("some_table")." (variable) VALUES ('$variable');

$Insert = $xoopsDB->query($Query);


I was wondering how I can insert that text into MySQL with out altering it so the query statment dosn't fail.

Thanks



22
zite83
Re: Xoops Date time
  • 2006/9/25 20:59

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


I will say the one thing I love about XOOPS is its community base! Thank you so much!



23
zite83
Xoops Date time
  • 2006/9/25 19:28

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


I am working on my own module and I have a simple question about XOOPS datetime function. When using XOOPS formloader the date/time is stored as "1159210227" which is just fine. What I am having troubles with is how to display that in my code/tempalte as a readable date and time.

Any pointers or code snippets would be great

Thanks



24
zite83
Xoops News Front Page
  • 2006/9/19 23:00

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


I love the way XOOPS has their news setup on the front page. I was wondering if that is a custom template and or script? I have news 1.44 installed and the only options I have for blocks are "top news" "recent news" ect..

Is there anyone that can tell me how XOOPS has thier news frontpage block set up?



25
zite83
Re: could use some Local Server software recommendations
  • 2006/9/19 20:47

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


Yes xampp is the best for simple ease of use.. Just download install and now you have apache MySQL php and more!



26
zite83
Re: Hack allows Extcal users to edit their own events
  • 2006/9/5 20:40

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


The final version of this hack can be found Here



27
zite83
Hack allows Extcal users to edit their own events
  • 2006/8/8 2:42

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


This hack allows users to edit their own events with out having to be an admin of the Extcal module.

This code works in conjuction with Extcal, so there is really no hacking, just copy the file into Extcal's directory.

Known problems:

(1) The edit button will always show up even if you are not allowed to edit the event.

(2)If auto approve is turned off for a group, re-editing an event by a user in that group will not set the event back to zero requiring the admin to reapprove.

(3) Users can not delete their own event

Add this line of code somewhere in (extcal_event.html) Do not replace the original edit button!
<a href="event_edit.php?op=modify&event_id=<{$event.event_id}>"><img src="images/edit.gif" /></a>


Save this file as (event_edit.php) in Extcal's main folder
<?php

include "../../mainfile.php";
include 
'../../class/xoopsformloader.php';
include_once 
'class/perm.php';

$extcalPerm ExtcalPerm::getHandler();
// If the user is allowed to submit an event in this category then pass on to next statment
if(count($extcalPerm->getAuthorizedCat($xoopsUser'extcal_cat_submit')) > 0) {

// At the moment this is the only way I know how to grab the events submitter ID
$event_ID $_REQUEST['event_id'];
$sql 'SELECT event_submitter FROM '.$xoopsDB->prefix('extcal_event').' WHERE event_id='.$event_ID;
$query mysql_query($sql);
while (
$row mysql_fetch_array($query)) { 
 
$event_submitter $row['event_submitter'];
}

// Does the user editing event = the events submitter? If so then move on
$user_uid $xoopsUser->getVar('uid');
if (
$event_submitter == $user_uid){



if(isset(
$_GET['op'])) {
    
$op $_GET['op'];
} else {
    
$op 'default';
}
$fct = isset($_POST['fct']) ? $_POST['fct'] : '';
if(!isset(
$_POST['form_submit']) && $fct == 'modify') {
    
$op 'modify';
} else if(!isset(
$_POST['form_submit']) && $fct == 'create') {
    
$op 'default';
}

if(isset(
$_GET['start'])) {
    
$start $_GET['start'];
} else {
    
$start 0;
}

switch(
$op) {
    
    case 
'enreg':
 
        
// Event edited
        
if($_POST['fct'] == 'modify') {
            
$catHandler xoops_getmodulehandler('cat''extcal');
            
$eventHandler xoops_getmodulehandler('event''extcal');
            if(!
preg_match('`[0-9]{4}-[01][0-9]-[0123][0-9]`'$_POST['event_start']['date'])) {
                
redirect_header('event_edit.php'3_MD_EXTCAL_WRONG_DATE_FORMAT."<br />".implode('<br />'$GLOBALS['xoopsSecurity']->getErrors()));
                exit;
            }
            list(
$year,$month,$day) = explode("-",$_POST['event_start']['date']);
            
$start mktime(0,0,0,$month,$day,$year) + $_POST['event_start']['time'];
            if(
$_POST['event_end_ok'] == 1) {
                if(
preg_match('`[0-9]{4}-[01][0-9]-[0123][0-9]`'$_POST['event_end']['date'])) {
                    list(
$year,$month,$day) = explode("-",$_POST['event_end']['date']);
                    
$end mktime(0,0,0,$month,$day,$year) + $_POST['event_end']['time'];
                } else {
                    
$end $start;
                }
            } else {
                
$end $start;
            }
            
$eventId = isset($_GET['event_id']) ? $_GET['event_id'] : $_POST['event_id'];
            
$dohtml = ($xoopsModuleConfig['dohtml_type'] != 0) ? 0;
            
$var_arr = array(
                
'event_title'=>$_POST['event_title'],
                
'cat_id'=>$_POST['cat_id'],
                
'event_desc'=>$_POST['event_desc'],
                
'event_contact'=>$_POST['event_contact'],
                
'event_url'=>$_POST['event_url'],
                
'event_email'=>$_POST['event_email'],
                
'event_address'=>$_POST['event_address'],
                
'event_approved'=>1,
                
'event_start'=>$start,
                
'event_end'=>$end,
                
'dohtml'=>$dohtml
            
);
            
$eventHandler->modifyEvent($_POST['event_id'], $var_arr);
            
redirect_header('event.php?event='.$eventId.''3'Event Edited'false);
        
        }
    
        break;
        
    case 
'modify':
    

        include 
XOOPS_ROOT_PATH.'/header.php';
        
$eventId = isset($_GET['event_id']) ? $_GET['event_id'] : $_POST['event_id'];
        
$eventHandler xoops_getmodulehandler('event''extcal');
        echo 
'<fieldset><legend style="font-weight:bold; color:#990000;">'.'Event Edited'.'</legend>';
        
$formSubmit $eventHandler->getSubmitFormDisplay($xoopsUser'event_edit.php?op=enreg''modify'$eventId);
        
$formSubmit->display();
        echo 
'</fieldset><br />';
        include 
XOOPS_ROOT_PATH.'/footer.php';
        
        break;
        
            }
        }
        
// Does the user editing event = the events submitter? If no, then redirect
        
else {redirect_header('index.php'3'Sorry, you can not edit this event'."<br />".implode('<br />'$GLOBALS['xoopsSecurity']->getErrors()));}
    }
else {
redirect_header('index.php'3_NOPERM."<br />".implode('<br />'$GLOBALS['xoopsSecurity']->getErrors()));}
?>


Thats it!



28
zite83
Extcal - allowing users(non admin) to edit own event?
  • 2006/8/7 3:32

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


Extcal is missing two major features that other calendar programs have. First one is repeating events and the other is to allow users who submitted an event to edit their own events with out being admin of the module.

What I am wondering is, has anyone created a hack for Extcal to allow users to edit their own event? If so can you point me in the right direction, if not I will try to finish up my own hack for it.



29
zite83
LDAP Auth Hack 0.6 getting started?
  • 2006/3/14 8:14

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


I just have my 2003 Server to tinker around with. I host my own XOOPS 2.0 on IIS 6. My question is for the LDAP Authentication Hack 0.6 do I need openLDAP or what do I need to get started so that I can have my room mates log in to our XOOPS home page with their windows login name?

I've been looking around and am just so confused dont know what I need to do?



30
zite83
I lost my Priv. Message Highlight?
  • 2005/9/24 15:58

  • zite83

  • Just popping in

  • Posts: 41

  • Since: 2004/10/5


I upgraded to XOOPS 2.2 and I am loving it! Just a quick question. It use to be "before it was turned into its own moduel" When I recieved new PMs my Inbox menu would be highlighted but now its not.. Is that normal? Or do I need to do alittle modification to have it highlighted again when I have new PMs?

Thanks Zite




TopTop
« 1 2 (3) 4 »



Login

Who's Online

252 user(s) are online (162 user(s) are browsing Support Forums)


Members: 0


Guests: 252


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