Дискусии околу vBulletin

  • Креатор на темата Креатор на темата Devilking
  • Време на започнување Време на започнување

Devilking

Tasmanian Devil
Член од
16 јануари 2006
Мислења
664
Поени од реакции
1
Возраст
40
Веб-сајт
www.vinicaonline.com
Интересни vBulletin Hacks!

Еве интересен vBulettin Hack кој автоматски создава Тема со која на членот на форумот кој на денешниот ден слави роденден му создава тема во која членовите можат да му го честитаат роденденот..

Еве како можете да го инсталирате овој мал додаток:

--------------------------------------
Фајлови кои треба да ги промените: /includes/cron/birthday.php
--------------------------------------

Во /includes/cron/birthday.php

<<<<<<<<<<<<<< Чекор 1 >>>>>>>>>>>>>>>>
Заменете:
--------------------------------------
$birthdays = $DB_site->query("
SELECT username, email, languageid, birthday
FROM " . TABLE_PREFIX . "user
WHERE birthday LIKE '$today-%' AND
(options & $_USEROPTIONS[adminemail]) AND
usergroupid IN ($ids)
");
--------------------------------------

Со:
--------------------------------------
$birthdays = $DB_site->query("
SELECT username, email, languageid, birthday, userid
FROM " . TABLE_PREFIX . "user
WHERE birthday LIKE '$today-%' AND
(options & $_USEROPTIONS[adminemail]) AND
usergroupid IN ($ids)
");
--------------------------------------

<<<<<<<<<<<<<< Чекор 2 >>>>>>>>>>>>>>>>
Под:
--------------------------------------
$emails .= $userinfo['username'];
--------------------------------------

Додадете:
--------------------------------------
$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n";
$bday_title .= $username.", ";
--------------------------------------

<<<<<<<<<<<<<< Чекор 3 >>>>>>>>>>>>>>>>
Под
--------------------------------------
log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);
--------------------------------------

Додадете:
--------------------------------------
// Create Birthday Thread Hack

$birthday_greeting_thread = "Dear Forum,<br><br>Here are today's birthdays!<br><br>$bday_people";
$greeter=1; //Your User ID
$greeter_name="Your User Name"; //Your User Name
$greetings_forum=1; //enter the forum id that you want the thread to go into
$todays_date11= date("F j, Y", mktime (date("H")+$timeset, date("i"), date("s"), date("m"), date("d"), date("Y")));
$title3= "Happy Birthday to ";
$title3.= $bday_title;
$title3.= "on ";
$title3.=$todays_date11;
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($title3))."','".time()."','$greetings_forum','1','0','".addslashes($greeter_name)."','$greeter','".addslashes($greeter_name)."','".time()."','0','1','0')");
$log_threadid=$DB_site->insert_id();
// Creating Post
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$log_threadid','".addslashes(htmlspecialchars($title3))."','".addslashes($greeter_name)."','$greeter','".time()."','".addslashes($birthday_greeting_thread)."','1','0','127.0.0.1','0','1')");
// Updating Forum
$DB_site->query("UPDATE " . TABLE_PREFIX . "forum SET replycount=replycount+1,threadcount=threadcount+1,lastpost='".time()."',lastposter='".addslashes($greeter_name)."' WHERE forumid = $greetings_forum");
// Updating User's Post
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET posts=posts+1 WHERE userid=$greeter");
// End Create Birthday Thread Hack
--------------------------------------

Заменете ги променливите за userid, username и forumid.

Можете да ја промените пораката помеѓу <<< EOF и EOF; таговите. Истото така можете да користите и IMG тагови.
--------------------------------------
 
Дај нешто друго, оваа не е потребна.. Тука членовите отвараат теми и „автоматски” им ги честитаат родендените на славениците. Во секој случај е поинтересно кога човек ќе ти го честита роденденот... :wink:

Друго нешто интересно?
 
Acid напиша:
Дај нешто друго, оваа не е потребна.. Тука членовите отвараат теми и „автоматски” им ги честитаат родендените на славениците. Во секој случај е поинтересно кога човек ќе ти го честита роденденот... :wink:

Друго нешто интересно?


Хмммм....ок....сеа ке постирам друга!! :)
Btw..сепак не е лошо и да ја знаат и оваа!! :)
 
Devilking напиша:
Хмммм....ок....сеа ке постирам друга!! :)
Btw..сепак не е лошо и да ја знаат и оваа!! :)

Ama koj go pravi ovaa ? Administratorite ili nie samite ?
 
New User Welcome Private Message:

Интересен Hack кој на новите регистрирани членови им прака Приватна порака како добредојде на форумот:

Инсталација:

------------ Open phpMyAdmin and run the following queries:

// ##############################################################################################

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom', 'register', '1', '1', '', 140, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmfrom_title', 'User Who Sends Automatic PM Upon Registration', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmfrom_desc', 'Enter the user ID of the person whose account you\'d like to be used when sending new users a welcome PM upon registering.', '5000');


INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtext', 'register', 'Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff', 'Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff', 'textarea', 150, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtext_title', 'Welcome PM Text', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtext_desc', 'Set the text of the PM sent to all new users.<br />\r<br />\rNote: You can use the following variables to specify the <b>user\'s</b> information: $username, $userid, $email. And you can use the $bbtitle to specify the board\'s name.', '5000');


INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtitle', 'register', 'Welcome to $bbtitle!', 'Welcome to $bbtitle!', '', 160, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtitle_title', 'Title Of the PM That is Automatically Sent to New Users', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtitle_desc', 'Set the title of the PM that is sent to all new users automatically. You can use the same variables as the ones that you can use for the PM text (see above).', '5000');

// ##############################################################################################

------------ Next, you MUST go: Admin CP --> Options --> vBulletin Options --> User Registration Options --> Save
-------- If you don't do this, you will get SQL errors when a user registers!


------------ Next, open ./register.php (if you are using vB3.0.2 or vB3.0.3 goto "to do.txt") and look for (AROUND LN 775):

// ##############################################################################################
if ($vboptions['newuseremail'] != '')
{
if ($havefields)
{
$DB_site->data_seek(0, $profilefields);
while ($profilefield = $DB_site->fetch_array($profilefields))
{
$varname = "field$profilefield[profilefieldid]";
$cfield = $$varname;
$customfields .= "$profilefield[title] : $cfield\n";
}
}

$username = $_POST['username'];
$email = $_POST['email'];
eval(fetch_email_phrases('newuser', 0));

vbmail($vboptions['newuseremail'], $subject, $message);
}

####################################################################
--------------------------------- OR -------------------------------
####################################################################

if ($vboptions['newuseremail'] != '')
{
if ($havefields)
{
$DB_site->data_seek(0, $profilefields);
while ($profilefield = $DB_site->fetch_array($profilefields))
{
$varname = "field$profilefield[profilefieldid]";
$cfield = $$varname;
$customfields .= "$profilefield[title] : $cfield\n";
}
}

$username = $_POST['username'];
$email = $_POST['email'];
eval(fetch_email_phrases('newuser', 0));

$newemails = explode(' ', $vboptions['newuseremail']);
foreach ($newemails AS $toemail)
{
if (trim($toemail))
{
vbmail($toemail, $subject, $message);
}
}
}

// ##############################################################################################

------------ AFTER ADD:

// ##############################################################################################

// ###################################################################
// # WELCOME PM HACK BY rob_daemon
// ###################################################################

$username = $_POST['username'];

// Process each one of the replacement vars
$vars = array(
'$bbtitle' => $vboptions['bbtitle'],
'$username' => $username,
'$email' => $email,
'$userid' => $userid
);

$pmoptions['regpmtext'] = $vboptions['regpmtext'];
$pmoptions['regpmtitle'] = $vboptions['regpmtitle'];
$pmoptions['regpmfrom'] = $vboptions['regpmfrom'];

// Now that we have the options, we need to process eaach of the
// vars we can use
foreach($vars AS $_key => $_value)
{
$pmoptions['regpmtext'] = str_replace($_key, $_value, $pmoptions['regpmtext']);
$pmoptions['regpmtitle'] = str_replace($_key, $_value, $pmoptions['regpmtitle']);
}

$get_pm_from = $DB_site->query_first("SELECT username,userid FROM " . TABLE_PREFIX . "user WHERE userid=$pmoptions[regpmfrom]");

// Send the new owner a PM
$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
$get_pm_from[userid],
'" . addslashes($get_pm_from['username']) . "',
'" . addslashes($pmoptions['regpmtitle']) . "',
'" . addslashes($pmoptions['regpmtext']) . "',
'" . addslashes(serialize(array($userid => $username))) . "',
0,
" . TIMENOW . ",
1,
1
)"
);

$pmtextid = $DB_site->insert_id();

$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pm
(
pmtextid,
userid,
folderid,
messageread
)
VALUES
(
'$pmtextid',
'$userid',
'0',
'0'
)"
);
// ###################################################################
// # END WELCOME PM HACK
// ###################################################################

// ##############################################################################################


Измени и во register.php for vB3.0.2 or 3.0.3:

find:

$username = $_POST['username'];
$email = $_POST['email'];
eval(fetch_email_phrases('newuser', 0));

$newemails = explode(' ', $vboptions['newuseremail']);
foreach ($newemails AS $toemail)
{
if (trim($toemail))
{
vbmail($toemail, $subject, $message);
}
}
}

after add:

// ################################################################################ ##############
// ###################################################################
// # WELCOME PM HACK BY rob_daemon
// ###################################################################

$username = $_POST['username'];

// Process each one of the replacement vars
$vars = array(
'$bbtitle' => $vboptions['bbtitle'],
'$username' => $username,
'$email' => $email,
'$userid' => $userid
);

$pmoptions['regpmtext'] = $vboptions['regpmtext'];
$pmoptions['regpmtitle'] = $vboptions['regpmtitle'];
$pmoptions['regpmfrom'] = $vboptions['regpmfrom'];

// Now that we have the options, we need to process eaach of the
// vars we can use
foreach($vars AS $_key => $_value)
{
$pmoptions['regpmtext'] = str_replace($_key, $_value, $pmoptions['regpmtext']);
$pmoptions['regpmtitle'] = str_replace($_key, $_value, $pmoptions['regpmtitle']);
}

$get_pm_from = $DB_site->query_first("SELECT username,userid FROM " . TABLE_PREFIX . "user WHERE userid=$pmoptions[regpmfrom]");

// Send the new owner a PM
$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
$get_pm_from[userid],
'" . addslashes($get_pm_from['username']) . "',
'" . addslashes($pmoptions['regpmtitle']) . "',
'" . addslashes($pmoptions['regpmtext']) . "',
'" . addslashes(serialize(array($userid => $username))) . "',
0,
" . TIMENOW . ",
1,
1
)"
);

$pmtextid = $DB_site->insert_id();

$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pm
(
pmtextid,
userid,
folderid,
messageread
)
VALUES
(
'$pmtextid',
'$userid',
'0',
'0'
)"
);
// ###################################################################
// # END WELCOME PM HACK
// ###################################################################
// ################################################################################ ##############


Ова испадна малку подолго, ама не би требало да претставува проблем на тој што сака да го инсталира...
 
Marlboro-light напиша:
Ama koj go pravi ovaa ? Administratorite ili nie samite ?

Администраторите се разбира...тоа е доколку си имаш свој форум и можеш да направиш извесни промени!!
 
Od kaj gi naogas ovie raboti? Samo za forumi ima ili i za nesto grugo?:kajg:
 
Одлично DevilKing, но во иднина пробај да ги користиш
Код:
 текст
HTML:
 текст
и
PHP:
 текст
кога ќе пастираш некој код, со цел текстот да нема форматирање и да биде по прегледен.

Ќе ги најдеш во уредувачот за пораки со следниве икончиња
code.gif
html.gif
php.gif
:wink:
 
Јасно ми е ацид...само едноставно ме мрзеше тоа да го правам...ај наредниот пат ке се погризам и за тоа...т.е. за наредниот пост...за некој саат време :)
 
Ме интересира дали некој има да ми прати македонски превод за vBulletin.
 

Kajgana Shop

Back
На врв Bottom