Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2008-05-20 01:40:29
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: must have hack?
Ohh, neato. So say I have this part in my code:
$link = mysql_connect("host", "user", "pass") or die("Can't connect.");
mysql_select_db("txp_form", $link) or die("Can't select database.");
I just take that out? And the rest be kept.
<txp:Ruhh />
Offline
Re: must have hack?
Yep. If Textpattern can connect to the db (which it can since you’re using it) your plugin is connected to the db. Just use the functions within txplib_db.php.
Offline
Re: must have hack?
Yep – just use the database functions (safe_*). BTW, txp_form is a table not a database :).
Edit: Man, I am slow today!
Last edited by jm (2008-05-20 01:43:31)
Offline
Re: must have hack?
Hah! JM, I beat you by 14 seconds though your response is a bit more informative ;)
Offline
#29 2008-05-20 01:48:31
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: must have hack?
Right, doh! I was just making a quick code. I gotta go through it and proofread.
<txp:Ruhh />
Offline
#30 2008-05-20 02:01:10
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: must have hack?
Uh, I’m confused. I have no idea where to go first in the Plugin Composer tab in order to create a plugin?
Sorry to bother with questions. I’m just new to this thing. o.O
<txp:Ruhh />
Offline
Re: must have hack?
I’d use the plugin cache, since it’s really simple – just point TXP to your plugin src (admin>prefs>adv). Here’s an example plugin too (change type to 1 for admin).
Last edited by jm (2008-05-20 02:27:13)
Offline
#32 2008-05-20 02:47:10
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: must have hack?
Ugh, I hate getting errors. I don’t even know how to fix them according to the error stated.
Last edited by Ruhh (2008-05-20 03:07:12)
<txp:Ruhh />
Offline
#33 2008-05-20 03:12:11
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: must have hack?
ied_plugin-composer Hmm.. I keep a copy here, but I might guess there is a reason for it not being available from the author’s site, and I am not capable of providing support for it.
I see you got one.
Last edited by rsilletti (2008-05-20 03:16:10)
Offline
#34 2008-05-20 03:22:13
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: must have hack?
Yes, I have it installed. Thanks to Stef. :p
I looked through my code and I just think there are no mistakes, however, I still get an error. What could the problems be if I get this error:
Parse error: syntax error, unexpected T_STRING, expecting ‘)’
<txp:Ruhh />
Offline
Re: must have hack?
Your string is probably not escaped – check your quotes.
BTW, hop onto #textpattern on irc.freenode.net for faster responses :).
Last edited by jm (2008-05-20 03:31:54)
Offline
#36 2008-05-20 03:35:44
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: must have hack?
Huh, where? What is the URL? :p
Ok, well this could be the line. Not sure though.
$types = array('article' => 'Article', 'comment' => 'Comment', 'file' => 'File', 'link' => 'Link', 'misc' => 'Misc');
<txp:Ruhh />
Offline