Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Little Badge Script
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Meap" data-source="post: 374248" data-attributes="member: 1553"><p>I posted this on the PlusEMU Support thread also because I was asking for help but I managed to figure it out a bit so this may help some of you</p><p></p><p>I was reading up on some stuff and managed to come together with this after compiling together some examples I found</p><p>This will auto give you the queries so you can just truncate your badge_definitions table and run this and it will make sure every badge works</p><p>If anyone wants to expand on this to make it search for if the badge already exists and skips that query from showing to stop duplicates so you dont have to truncate everytime It would be highly appreciated because its 5am for me right now and my mind isnt so fresh</p><p>Just replace DATABASENAME with your database name</p><p>[PHP]<?php</p><p>$target = "c_images/album1584/";</p><p>$weeds = array('.', '..');</p><p>$directories = array_diff(scandir($target), $weeds); </p><p>foreach($directories as $value)</p><p>{</p><p>$gifkill=str_replace('.gif', '', $value);</p><p>$gif2kill=str_replace('.GIF', '', $gifkill);</p><p>$uppercasewords=ucwords($gif2kill);</p><p>if(is_file($target.$value))</p><p>{</p><p>echo "INSERT INTO `DATABASENAME`.`badge_definitions` (`code`, `required_right`) VALUES ('".$uppercasewords."', '');<br />";</p><p>}</p><p>}</p><p>?>[/PHP]</p></blockquote><p></p>
[QUOTE="Meap, post: 374248, member: 1553"] I posted this on the PlusEMU Support thread also because I was asking for help but I managed to figure it out a bit so this may help some of you I was reading up on some stuff and managed to come together with this after compiling together some examples I found This will auto give you the queries so you can just truncate your badge_definitions table and run this and it will make sure every badge works If anyone wants to expand on this to make it search for if the badge already exists and skips that query from showing to stop duplicates so you dont have to truncate everytime It would be highly appreciated because its 5am for me right now and my mind isnt so fresh Just replace DATABASENAME with your database name [PHP]<?php $target = "c_images/album1584/"; $weeds = array('.', '..'); $directories = array_diff(scandir($target), $weeds); foreach($directories as $value) { $gifkill=str_replace('.gif', '', $value); $gif2kill=str_replace('.GIF', '', $gifkill); $uppercasewords=ucwords($gif2kill); if(is_file($target.$value)) { echo "INSERT INTO `DATABASENAME`.`badge_definitions` (`code`, `required_right`) VALUES ('".$uppercasewords."', '');<br />"; } } ?>[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Little Badge Script
Top