ROZWIĄZANY: Stworzenie własnego 'taska'
#1
Napisano 09 luty 2009 - 00:02
Można cuś takiego zrobić ;>?
#2
Napisano 09 luty 2009 - 00:06
#4
Napisano 09 luty 2009 - 00:24
#6
Napisano 09 luty 2009 - 00:29
#8
Napisano 09 luty 2009 - 00:37
Szablon taska:
<?php
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
//TYLKO TUTAJ ŁADUJESZ SWOJ KOD. NIC INNEGO NIE ZMIENIASZ.
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlock_task( $this->task );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->ipsclass =& $class->ipsclass;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>W miejsce:
//TYLKO TUTAJ ŁADUJESZ SWOJ KOD. NIC INNEGO NIE ZMIENIASZ.
Wstawiasz swój kod, zapisujesz np. pod nazwą riptask.php i potem w ACP dodajesz nowe zadanie w sekcji zarządzania taskami.
W sumie to wszystko masz podane.
#10
Napisano 09 luty 2009 - 00:39
#11
Napisano 09 luty 2009 - 14:34
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
UPDATE ibf_topics SET title = REPLACE(title, '[RS]', '') WHERE title LIKE '%[RS]%';
UPDATE ibf_topics SET title = REPLACE(title, '[rs]', '') WHERE title LIKE '%[rs]%';
//TYLKO TUTAJ ŁADUJESZ SWOJ KOD. NIC INNEGO NIE ZMIENIASZ.
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlock_task( $this->task );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->ipsclass =& $class->ipsclass;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
Niestety przy ustawieniach pokazanych na screenie nie wykonuje tych zapytań w bazie danych. Gdzie popełniłem błąd ;>?
Załączone pliki
-
task.PNG (36,07 KB)
Ilość pobrań: 9
#12
Napisano 09 luty 2009 - 14:45
Musisz użyć formy zapytań używanych w IP.Board - zalecam lekturkę jakiegoś pliku, choćby sources/action_public/topics.php - tam pełno kodu dotyczącego zapytań do bazy danych.
#13
Napisano 11 listopad 2009 - 01:20
Stworzyłem coś takiego (dodałem tam gdzie kazałeś)
$this->ipsclass->DB->simple_construct( array( 'update' => 'topics', 'set' => 'title =', 'REPLECE' => (title, '[RS]', ''), 'where' => 'title', 'LIKE' => '%[RS]%') ); $this->ipsclass->DB->simple_exec();
Pewnie jest tutaj dużo błędów, starałem się czytać w action public wspierając się manualem php (php.net.pl), lecz nie działa.
BTW. chyba w końcu czas na jakiś kurs php z allegro :/
Użytkownik Dr R.I.P edytował ten post 11 listopad 2009 - 01:21
#14
Napisano 11 listopad 2009 - 01:36
Udostępnij ten temat:
Podobne tematy
| Temat | Forum | Autor | Podsumowanie | Ostatni post | |
|---|---|---|---|---|---|
|
ROZWIĄZANY: Stworzenie nowego skina/layouta
|
Skiny - pomoc |
unbreak
|
|
|
|
zlecę stworzenie najprostszego rankingu
|
Inne |
24i7
|
|
|
|
|
Modyfikacje w produkcji |
Łukasz
|
|
|
|
[kupie]Stworzenie tła profilu pod wersje 3.05
|
Kupię |
Łukasz
|
|
|
|
[Zlecę] Stworzenie theme dla forum
Pocięcie i przerobienie PSD |
Inne |
muzwar
|
|


Pomoc
Temat jest zamknięty


Do góry
Cytuj

















