vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   AutoPM after addBuddy (https://vborg.vbsupport.ru/showthread.php?t=104872)

Antivirus 01-09-2006 08:32 PM

ok i fixed it i think I zipped the wrong file that time sorry:smoke:

Snoop-It 01-09-2006 08:40 PM

excellent, now it works. cheers man!

Antivirus 01-09-2006 08:43 PM

cool

jj 01-09-2006 08:46 PM

Just looked into your changes ;) I think if you can use a self-made bbcode you also could use the standard url bbcode so there is no need to add a custom bbcode. You could do that by inserting
HTML Code:

[url=$2/profile.php?do=addlist&userlist=buddy&u=$3]click to accept[/url]
into the phrase. For example (a 3rd person message phrase version):
HTML Code:

Hello,

$1 has added you to his buddy-list. If you like to get friends you need to add $1 to your buddy-list, too.

[url=$2/profile.php?do=addlist&userlist=buddy&u=$3]Click here[/url] to add $1 to your buddy-list now.

The Board Admin

Now if you go on with the code I posted above to use the Username in the title and message, we get
Code:

$anti_autopm_bud_tit = str_replace("$1",$vbulletin->userinfo['username'],$vbphrase[anti_autopm_bud_tit]);
$pmdm->set('title', $anti_autopm_bud_tit);
$anti_autopm_bud_mes = str_replace("$1",$vbulletin->userinfo['username'],$vbphrase[anti_autopm_bud_mes]);
$anti_autopm_bud_mes = str_replace("$2",$vbulletin->options['bburl'],$anti_autopm_bud_mes);
$anti_autopm_bud_mes = str_replace("$3",$vbulletin->userinfo['userid'],$anti_autopm_bud_mes);
$pmdm->set('message', $anti_autopm_bud_mes);

I haven't tested the above thing and don't know if it works, but you may work it out yourself :) Keep on the learning.

EricaJoy 01-09-2006 08:46 PM

cool beans, i'm sure i will be clicking install momentarily..

The Chief 01-09-2006 09:18 PM

Quote:

Originally Posted by j.jacobsen
Just looked into your changes ;) I think if you can use a self-made bbcode you also could use the standard url bbcode so there is no need to add a custom bbcode. You could do that by inserting
HTML Code:

[url=$2/profile.php?do=addlist&userlist=buddy&u=$3]click to accept[/url]
into the phrase. For example (a 3rd person message phrase version):
HTML Code:

Hello,

$1 has added you to his buddy-list. If you like to get friends you need to add $1 to your buddy-list, too.

[url=$2/profile.php?do=addlist&userlist=buddy&u=$3]Click here[/url] to add $1 to your buddy-list now.

The Board Admin

Now if you go on with the code I posted above to use the Username in the title and message, we get
Code:

$anti_autopm_bud_tit = str_replace("$1",$vbulletin->userinfo['username'],$vbphrase[anti_autopm_bud_tit]);
$pmdm->set('title', $anti_autopm_bud_tit);
$anti_autopm_bud_mes = str_replace("$1",$vbulletin->userinfo['username'],$vbphrase[anti_autopm_bud_mes]);
$anti_autopm_bud_mes = str_replace("$2",$vbulletin->options['bburl'],$anti_autopm_bud_mes);
$anti_autopm_bud_mes = str_replace("$3",$vbulletin->userinfo['userid'],$anti_autopm_bud_mes);
$pmdm->set('message', $anti_autopm_bud_mes);

I haven't tested the above thing and don't know if it works, but you may work it out yourself :) Keep on the learning.


this works great, but it sucks that it opens in a new window...

it would be better if it just opened in the same window, but good idea noneless ;)

msimplay 01-10-2006 07:39 AM

excellent addition but i have this hack that allows members to choose wether they save a copy of their pms or not and regardless of wether they have it turned on or off it still saves the pm any chance of making it adhere to the savecopy rules ?

https://vborg.vbsupport.ru/showthrea...light=savecopy

jj 01-10-2006 11:08 AM

Quote:

Originally Posted by msimplay
excellent addition but i have this hack that allows members to choose wether they save a copy of their pms or not and regardless of wether they have it turned on or off it still saves the pm any chance of making it adhere to the savecopy rules ?

https://vborg.vbsupport.ru/showthrea...light=savecopy

Don't want to Download the zip and look into it, but I looked into some postings. It seems there is a field added to the user table according to this post, so why don't you just try this:

Replace in Original code of the plugin:
Code:

$pmdm->set_info('savecopy', 1);
with
Code:

$pmdm->set_info('savecopy', $vbulletin->userinfo['savecopy']);

Revan 01-10-2006 12:48 PM

This is lush, I foresee this having a boatload of installs even if not HOTM (I always type HTML when I try to type HOTM :p)

Might I suggest using {1}, {2}, ... {n}, like so:
Change phrase "anti_autopm_bud_mes" to this:
HTML Code:

Hello,

{1} has added you to his buddy-list. If you like to get friends you need to add {1} to your buddy-list, too.

[url={2}/profile.php?do=addlist&userlist=buddy&u={3}]Click here[/url] to add {1} to your buddy-list now.

The Board Admin

Change the "anti_autopm_bud_tit" to this:
Code:

{1} has just added you to his buddy list!
Change this snippet of code:
PHP Code:

$anti_autopm_bud_tit str_replace("$1",$vbulletin->userinfo['username'],$vbphrase[anti_autopm_bud_tit]);
$pmdm->set('title'$anti_autopm_bud_tit); 
$anti_autopm_bud_mes str_replace("$1",$vbulletin->userinfo['username'],$vbphrase[anti_autopm_bud_mes]);
$anti_autopm_bud_mes str_replace("$2",$vbulletin->options['bburl'],$anti_autopm_bud_mes);
$anti_autopm_bud_mes str_replace("$3",$vbulletin->userinfo['userid'],$anti_autopm_bud_mes);
$pmdm->set('message'$anti_autopm_bud_mes); 

to this:
PHP Code:

$anti_autopm_bud_tit construct_phrase($vbphrase['anti_autopm_bud_tit'], $vbulletin->userinfo['username']);
$anti_autopm_bud_mes construct_phrase($vbphrase['anti_autopm_bud_mes'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'], $vbulletin->userinfo['userid']);
$pmdm->set('title'$anti_autopm_bud_tit);
$pmdm->set('message'$anti_autopm_bud_mes); 

Saves inventing a whole new construct_phrase() function ;)

Again, nice work :)

msimplay 01-10-2006 03:46 PM

Quote:

Originally Posted by j.jacobsen
Don't want to Download the zip and look into it, but I looked into some postings. It seems there is a field added to the user table according to this post, so why don't you just try this:

Replace in Original code of the plugin:
Code:

$pmdm->set_info('savecopy', 1);
with
Code:

$pmdm->set_info('savecopy', $vbulletin->userinfo['savecopy']);

Thanks works great


All times are GMT. The time now is 02:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01376 seconds
  • Memory Usage 1,766KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (5)bbcode_html_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete