Stefano Mtangoo 455 Senior Poster

I will pretend that I have understood and open to correction :)
I will assume also that you can query the database. There might be several way to do that but one of them is this for procedure (a bit different and easy for OOP)

index.php

<?php
include("functions.php");
?>
<html>
<head>
<title><?php echo getTitleFromDbFunction($argumentIfAny); ?></title>
</head>
<body>
<!---put your body stuffs here-->
</body>
</html>

functions.php

<?php
function getTitleFromDbFunction($argumentIfAny){
//get the title from database.argumentIfAny can be ID of title from Get or whatever
return $theRetrievedTitle;

}
?>

Note: this is to give Idea, untested and so unwarranted!

-==Zero==- commented: Thanks So Much -==Zero==- +2
Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

Get MySQL workbench and give it a go. If you use netbeans it have services tab and there you can connect

Stefano Mtangoo 455 Senior Poster

Please rephrase your question. I have not even got a clue of what you want! Try to be specific and give more data like schema et al

Stefano Mtangoo 455 Senior Poster

I think best way is to find closest plugin existing and modify that. Surely you have familiarized yourself with documentation like http://live.gnome.org/Rhythmbox%20Plugins/Python%20Plugin%20Examples

Thanks, I have read that a little and I will be back after I begin it.
What about Podcasting module/Format? Got one? Know one?

Stefano Mtangoo 455 Senior Poster

Hi All,
Its long have not been here. Python have been a language that have refused to get off my shoulders. After more than a year or two I'm back. And to cut story shot is, though I love Rhythmbox, It have the poorest Podcasting module I have ever encountered. I was totally displeased and it misses a lot. I thought I will program my plugin for RB and Python is easier. So I have questions:
1. I'm confused on adding GUI stuffs so if there is anyone who knows about it or link can help me.
2. Is there any good and maintainable Podcasting module for Python?
3. Is Python 2.7 or 3.2 useful as far as now?
4. Any suggestion on my start?
I hope the forum is as active as it used to be!

Stefano Mtangoo 455 Senior Poster

I should try netbeans :)

I suggest that, up until Aptana 3 becomes matured. It is cute but still childish somehow!

Stefano Mtangoo 455 Senior Poster

I don't think Aptana3.0 has PHP debugging. Try installing 2.0.

Apatana3.0 tries to do too much (has too much built in) and less ability to use external plugins which makes it less customizable. I'm using the prebuilt version however, maybe you can get better results with the Eclipse plugin version.

Hi DE,
long time I have not seen here :)
BTW I was attracted by version 3. I will have to wait for 3.1 and meanwhile I will keep my netbeans.
Thanks for reply!

Stefano Mtangoo 455 Senior Poster

The link I gave above teaches step by step exactly what OP is trying to do and he/she completely ignored it!

Stefano Mtangoo 455 Senior Poster

No Eclipse/Aptana yet?

Stefano Mtangoo 455 Senior Poster

First use Code tags in your posts. Secondly try to read tutorial in this link, since you are new, to get rough Idea of what you are supposed to do!

Stefano Mtangoo 455 Senior Poster

I'm impressed with Aptana Studio 3 and it is wonderful. I have decided to go back to eclipse after years of using Netbeans. In NB I was having option of separating my files from project meta data but I cannot find how to do it with AS. Also in Netbeans debugging and running server is breeze but cannot find it in Eclipse. So any help in the aspects is appreciated
Thanks

Stefano Mtangoo 455 Senior Poster

Hahahaaa! My Question is already answered (Can't believe you didn't saw it :))
Anyway the problem was not with whole class and I cannot see the reason to post the whole long thing.
Thanks for the post anyway....keeping DW alive :)

Stefano Mtangoo 455 Senior Poster

Custom? What really means custom … that you programmed a bit … Where is the class definition are you trying to programming OOP without even read the basics ( one page …. 5 minutes your try more than 5 and this post 10) waste of time … isn’t it ?

I forgive you because you don't know what and who you are talking to :)
I think you were too swift to read this:
Below is the constructor and insertusers method that fails.

So No class no what. Just information, minimal for my question!
BTW I have been into OOP for a time now doing it in Major languages: Python, PHP, C++, Java et al
Got it now?

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

Hi, I'm making a custom user management class that inherits from DBManager class. The problem I have so far is executing queries using mysqli prepared statements. DB connects fine but then prepare statement fails. I have mysqli object as an attribute that is shared in the class. I'm new with this mysqli (all the times I used normal mysql). Below is the constructor and insertusers method that fails.
Thanks

<?php

protected  $dbLink;
protected  $errorMsg = array();//Inherited by other functions

public function __construct() {
$this->dbLink = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
    $this->addError(mysqli_connect_error());
}
}

public  function insertUsers($arrayofValues) {
        //for inserting users in the database
        $sql = "INSERT INTO users(firstname, lastname, email, username, password) VALUES(?, ?, ?, ?, ?";
        if( $stmt = $this->dbLink->prepare($sql)) {
            $type = array("sssss");
            $params = array_merge($type, $arrayofValues);
            call_user_func_array(array($stmt, 'bind_param'), $this->refValues($params));
            $stmt->execute();
            
            if($stmt==-1) {
                //query failed
                $this->addError(mysqli_connect_error());
                return false;
            }else {
                return true;
            }
        }
        else{
            $this->addError("Something went wrong before InsertUsers stmt could execute well");
        }
    }
?>
Stefano Mtangoo 455 Senior Poster

That is very useful. It means I better create objects than "hide" them in sessions. I was having that though only with no rational reason! Thanks for that!

And what about the best way to deal with user information? Put them as attribute of object (Array) or store Id in session and Pull the rest from DB using that ID?

Stefano Mtangoo 455 Senior Poster

Why waste all the time while you can solve the problem by removing space? I cannot see what is so peculiar about that space. as Ardav said, remove it and you will be fine!

Stefano Mtangoo 455 Senior Poster

Hi,
I have Object that performs not only registration/Login but also manages users after the log in. Does it make sense to store object of that class in session or I should only store userID on session and use that to Query DB? My Object will contain user details (Full name, Username et al).

Which makes more sense? If I'm not clear, please let me know. I'm trying to make usable User Management Class that I will be using in all My system for login/register and user management in general (ACL).

Thanks

Stefano Mtangoo 455 Senior Poster

start new thread seeing that this thread have white hair in it ;)

Stefano Mtangoo 455 Senior Poster

practicing makes perfect!

Stefano Mtangoo 455 Senior Poster

You better use Gparted and make one extended partition. Extended partiton can have more partition on it!

Stefano Mtangoo 455 Senior Poster

solved?

Stefano Mtangoo 455 Senior Poster

Long live wxWidgets! Its is not the best but it have always does what I needed to do!
You cannot find 100% perfect toolkit out there. Even QT have its downsides

Stefano Mtangoo 455 Senior Poster

which link?

Stefano Mtangoo 455 Senior Poster

did you understand what I wrote above. It have that answer

Stefano Mtangoo 455 Senior Poster

I have no idea too what is your problem!

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

which library do you use to write/update XML?

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

what is exactly the error thrown?

Stefano Mtangoo 455 Senior Poster

no sir.. i need only ideas,suggestions or tips if how to start to make this program.. coz im only 1st yr college student in philippines.. hope you understand sir..

There goes a "suggestion"

Stefano Mtangoo 455 Senior Poster

each time user logs in check if he is banned and if yes check if ban time is expired. If yes then allow him to do thing other can do. if no redirect him to ban info page.Also when he logs in and ban time is passed, reset his ban status.
There you know what to put into database right?

Stefano Mtangoo 455 Senior Poster

Sounds like Homework and I will help you with this:
http://lmgtfy.com/?q=sql+like+operator

Stefano Mtangoo 455 Senior Poster

what about checked? Something like:

<?php foreach ($months as $key => $value) { ?> 
	<input type="checkbox" name="months[]" id="months" value="<?php echo $key; if(this_is_selected_somehow){echo ' checked'} ?>" style="text-align:right; direction:rtl; ">  
<?php } ?>
Stefano Mtangoo 455 Senior Poster

Thanks, I need to create the code for my project and unfortunately, I don't have enough time to look at something like that (implements ideas beyond my current understanding). Thank you for your help however.

We always stretch our understanding don't we? Anyway, the link have more to do of design technique than coding. so you may well read it or ignore it. it is your prerogative :)

Stefano Mtangoo 455 Senior Poster

U're welcome.
Mark it solved then

Stefano Mtangoo 455 Senior Poster

redirec with header
Beware of headers already sent thing ;)

Stefano Mtangoo 455 Senior Poster

Could you post your schema? I can guess it is not well designed. just my guess

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

I though I would share this link for design of plugin architecture, since you mentioned it somewhere :)

Stefano Mtangoo 455 Senior Poster

I can't help because I don't know what you want to do and what is not working!
Sorry!

Stefano Mtangoo 455 Senior Poster

To do that with C++, you need something like libcurl (http://curl.haxx.se/libcurl/).

That is what OP need. But be warned of this:

There's basically only one thing to keep in mind when using C++ instead of C when interfacing libcurl:

The callbacks CANNOT be non-static class member functions

Example C++ code:

class AClass {   static size_t write_data(void *ptr, size_t size, size_t nmemb,   void *ourpointer)   {   /* do what you want with the data */   }  }

Source

Stefano Mtangoo 455 Senior Poster

Oops I will add that. Thanks for pointing that!

Stefano Mtangoo 455 Senior Poster

I though I would share this trick with you!
Enjoy :)

Stefano Mtangoo 455 Senior Poster

check example under System(). just replace ls and its args with your command. which level of programming are you in?

Stefano Mtangoo 455 Senior Poster

so what is your question?

Stefano Mtangoo 455 Senior Poster

is this what you want? If no elaborate

Stefano Mtangoo 455 Senior Poster

first, Manual should be the first place to poke. Then google is your best friend.
BTTT, Here are examples for Manual:
System()

system
(PHP 4, PHP 5)
system — Execute an external program and display the output

examples:

<?php
echo '<pre>';

// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
$last_line = system('ls', $retval);

// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
?>

exec

exec
(PHP 4, PHP 5)
exec — Execute an external program

examples:

<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>