Customizing SMF > Portals, Bridges, and Integrations

New tools to help integrating SMF with something else

<< < (18/27) > >>

Ardenstone:
Thanks, Andre!  That worked like a charm.  I added that exit() earlier while trying to fix some other bug and never thought to take it out again.  Silliness on my part, and a quick and excellent response on yours.

All the best,
   Chris

souf0:
Hi,
I'm searching for a api function for ban a user, but there aren't in this api file.
I think it's easy to make a function to ban some user using this api, there aren't no problem, no? Using $smcFunc['db_query'] and the query for to ban someone...
Thanks

Andre N:
Hi :)
If you take a look at how SMF does it in Sources/ManageBans.php in the function BanEdit() you should be able to figure out the queries you'll need to create a new ban.
Alternatively, it looks like you can set the user value is_activated to be > 10 and the user will be banned... That's how it looks to me anyways from looking at the code. You'd do that like like this:

--- Code: ---smfapi_updateMemberData($user, array('is_activated' => 11));

--- End code ---
Where $user is the email address, member id or username of the person that will be banned
Try it out and let us know if you can

stefann:
Just a tip for anyone else using different database users for the bridge & forum, if you do not provide write access to the SMF settings table, you may experience random & intermittent fatal errors when including this or any other SSI script eg
--- Code: ---INSERT,DELETE command denied to user 'bridge_smf'@'localhost' for table 'smf_settings'
--- End code ---
so you probably want to look at the seed generation around line 645, or even comment it out if you know you can trust the forum for entropy

EpicorUsersGroup:
Thanks for the API it is working well for my application.  How would I go about creating new boards within my forum from my application?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version