string - How to make a text replacement in PHP? -
Then adding commands to a very popular vbulletin plugin, and there is no one who works properly I do not have any problem for that. I still have the code
$ cybcb_checkban = strpos ($ vbulletin-> GPC ['CCB_NETS'], '/ restriction'); If ($ cybcb_checkban! == incorrect and $ cybcb_candelall) {$ banuserurl = $ vbulletin- & gt; Options ['Biberal']. // Misc.php? '$ Vbulletin- & gt; Session-> Wars ['sessionurl'] '= ccb_banuser & amp; U = 2 ';. exec_header_redirect ($ banuserurl); } What do I need to do to say that part
do = ccb_banuser and u = 2 > Changes 2 with the text entered in my chat. Vulleletin is a bit of your own language but its basic concept is PHP, but for reference, this is a default command already in plug-in
$ cybcb_checkme = strpos ($ vbulletin-> gtc ['ccb_newmessage'], '/ mi'); If ($ cybcb_checkme! == incorrect) {$ vbulletin- & gt; GPC ['ccb_newmessage'] = str_replace ('/ m', $ vbulletin- & gt; User information ['username \]].', $ Vbulletin- & gt; GPC ['ccb_newmessage']); $ Vbulletin- & gt; GPC ['ccb_newmessage'] = '[color ='. $ Vbulletin- & gt; Options [cybchatbox_mecolor '].'] * '. $ Vbulletin- & gt; GPC ['ccb_newmessage']. ' [/ Colour]'; } I am playing with this for a few days, and I have found the only result. Semi work is the first code on top, the problem is that as you
User may appear by entering restricted user 2 (obviously)
/ restriction
$ vbulletin-> Option ['bburl'] '/ misc.php?' $ Vbulletin- & gt; Session-> Wars ['sessionurl'] '= ccb_banuser &. U = $ vbulletin->. Gpc ['ccb_newmessage'] '; exec_header_redirect ($ banuserurl);
But does it seem to work = / no answer? Or can tell me in the right direction, I am very grateful) = Thanks.
$ vbulletin-> GPC ['ccb_newmessage'] will include the entire message, so if you send a restriction from / 123455 $ vbulletin-> and; GPC ['ccb_newmessage'] will have a restriction of / 123455 what you can do then 'Remove' / Restrictions '' and you will be left with the User ID Something like this
$ cybcb_checkban = strpos ($ vbulletin-> gtc ['ccb_newmessage'], '/ restriction'); If ($ cybcb_checkban! == incorrect and $ cybcb_candelall) {$ vbulletin-> Gpc ['ccb_newmessage'] = str_replace ('/ restriction', '', $ vbulletin-> gtc ['ccb_newmessage']); $ Banuserurl = $ vbulletin- & gt; Options ['Biberal']. '/ Misc.php?' $ Vbulletin- & gt; Session-> Wars ['sessionurl']. 'Do = ccb_banuser & amp; u = '. $ Vbulletin- & gt; Gpc ['ccb_newmessage']; exec_header_redirect ($ banuserurl); } or
$ cybcb_checkban = strpos ($ vbulletin-> gtc ['ccb_newmessage'], '/ restriction'); If ($ cybcb_checkban! == incorrect and $ cybcb_candelall) {$ banuserurl = $ vbulletin- & gt; Options ['Biberal']. // Misc.php? '$ Vbulletin- & gt; Session-> Wars ['sessionurl']. 'Do = ccb_banuser and u =' substr ($ vbulletin-> gtc ['ccb_newmessage'], 4); exec_header_redirect ($ banuserurl); } should work
Note: 4 might be written as substr ($ vbulletin-> GPC ['ccb_newmessage'], strops ($ vbulletin - & gt; GPC ['ccb_newmessage'], '/ restriction') + strlen ('/ restriction');
Comments
Post a Comment