DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • November 20, 2018, 05:58:39 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2 3 ... 8   Go Down
  Print  
Author Topic: The Guilds Clans Mod  (Read 24174 times)
0 Members and 1 Guest are viewing this topic.
lonnyl
Guest
« on: April 23, 2004, 06:31:52 AM »

Ok the newest update I believe deals with a bug where a dead user can click on the 3 letter code for their guild in the commentary of shades and get to their clan and heal themselves (thus a free resurection)  to be safe I have added to the guilds-clans.php

after
require_once "guildclanfuncs.php";
add....
if ($session[user][alive]==0) redirect("shades.php");

Also I started a thread here in the modders area hopefully to get the discussion on this mod into here as it is an existing mod and belongs in here.  I will try and update everyone with the fixes or changes that I have done.... maybe we can help dasher move this project along a little as it is a pretty big mod.

Logged
lonnyl
Guest
« Reply #1 on: April 23, 2004, 06:38:18 AM »

one of them I needed to change to get things working.....

in guildclanfuncs.php

$sql="select rankorder, rankid, displaytitle, dkrequired, assignedbymgmt from lotbd_guildranks where guildID='".$guildID."' order by RankOrder ASC, RankID Asc";

line 1934 in my file.... hope this helps.....

Logged
lonnyl
Guest
« Reply #2 on: April 23, 2004, 06:48:44 AM »

ok I will try to post a few more changes here..... this will add stipend to the management users as well as assign rank.... however rank does not display properly.

in guildclanfuncs.php

find this section approx line 1514 and add the noted lines (-->).

if ($Manage) {
        $ManagementTableActions.="<td><a href='guilds-clans.php?op=manage&action=demote&id=".$guildID."&who=".$val['acctid']."'>[demote]&nbsp;</a>";
        $ManagementTableActions.="<a href='guilds-clans.php?op=manage&action=banish&id=".$guildID."&who=".$val['acctid']."'>[banish]&nbsp;</a>";
        $ManagementTableActions.="<a href='guilds-clans.php?op=manage&action=addtohitlist&id=".$guildID."&who=".$val['acctid']."'>[Add to Hitlist]&nbsp;</a>";
-->        $ManagementTableActions.="<a href='guilds-clans.php?op=manage&action=assignrank&id=".$guildID."&who=".$val['acctid']."'>&nbsp;[Assign Rank]</a>";
-->        $ManagementTableActions.="<a href='guilds-clans.php?op=manage&action=pay&id=".$guildID."&who=".$val['acctid']."'>&nbsp;[Stipend]</a></td>";
        addnav("","guilds-clans.php?op=manage&action=demote&id=".$guildID."&who=".$val['acctid']);
        addnav("","guilds-clans.php?op=manage&action=banish&id=".$guildID."&who=".$val['acctid']);
        addnav("","guilds-clans.php?op=manage&action=addtohitlist&id=".$guildID."&who=".$val['acctid']);
        -->addnav("","guilds-clans.php?op=manage&action=assignrank&id=".$guildID."&who=".$val['acctid']);
        -->addnav("","guilds-clans.php?op=manage&action=pay&id=".$guildID."&who=".$val['acctid']."");
    } else {


ok now more changes to make this work.
replace the assignrank function with....
function AssignRank($guildID) {

// Assign one or more members to a rank

 global $HTTP_GET_VARS, $_POST;
 global $session;
 $stage=$HTTP_GET_VARS['stage'];

 switch ($stage) {
    case "2":
        $who=$_POST['who'];
        if ($who!="") {
            $toRankID=$_POST['sections'];
            if ($who==$session[user][acctid]){
               $session[user][guildrank]=$toRankID;
            }else{
            $sql="update accounts set guildrank=".$toRankID." where acctid in (".$who.")";
            db_query($sql);
           }
            output("`nMembers have been assigned the new rank!");
        } else {
            output("You need to select somebody first!!");
        }
    break;

    default:
        $return=CalcReturnPath();
        $who=$HTTP_GET_VARS['who'];
        if (isset($who)) {
            $friendlyName = ListToNames($who);
            output("`0Assign ".$friendlyName." `0to a new rank",true);
        } else {
            $who=$_POST['checked'];
            if ($who!="") {
                $keys=array_keys($_POST['checked']);
                $who="";
                for ($i=0; $i<count($keys);$i++) {
                    $who.=$keys[$i].(($i==count($keys)-1)? "":",");
                }
                $PeopleToPromote=ListToNames($who, false);
                output("`n`0Assign ".$PeopleToPromote." `0to a new rank",true);
            } else {
                // Nobody has been selected at all!
                output("Nobody has been selected!");
                return;
            }
        }
        $ranks=populateranks($guildID);
        output("<form action='".$return."&stage=2' method='POST'>",true);
        addnav("",$return."&stage=2");
        output("`n`nAssign Members to the Rank of: ");
        output("<input type='hidden' name='who' value='".$who."'/>",true);
        output("<SELECT NAME=sections >",true);
        foreach ($ranks as $rank) {
            output("<OPTION value='".$rank['rankid']."'>".$rank['displaytitle']."</OPTION>",true);
        }
        output("</SELECT>",true);
        output("<script language='javascript'>document.getElementById('sections').focus();</script>",true);
        output("`n<input type='submit' class='button' value='Save'/>",true);
        output("</form>",true);
    break;
 }
}

now replace the paymember funcion with....
function PayMember($guildID, $who) {

// Pay a member a some gold/gems from the guild funds

    global $session, $HTTP_GET_VARS;
    $stage=$HTTP_GET_VARS['stage'];
    $ThisGuild=&$session['guilds'][$guildID];
    if ($who<>$session[user][acctid]){
    $MemberName = ListToNames($who, true);
   }else{
      $MemberName = $session[user][name];
   }
    switch ($stage) {
             default:
// Transfer Sequence
                if (($ThisGuild['gold']<=0) and ($ThisGuild['gems'])) {
                    output("`6The little transfer gnome tells you that he refuses to transfer money for someone who is in debt.");
                    return;
                }
                output("`6`bTransfer To Member`b:`n");
                output("You may transfer Gold or Gems to your Guild `^".$MemberName."",true);
                // Unlimited transfer
                $return=CalcReturnPath();
                output("<form action='".$return."&who=".$who."&stage=2' method='POST'>",true);
                if ($ThisGuild['gold']>0) output("<input type=radio name='type' value='gold' checked> Gold<br>",true);
                if ($ThisGuild['gems']>0) output("<input type=radio name='type' value='gems'> Gems<br>",true);
                output("Transfer <u>h</u>ow much: <input name='amount' id='amount' accesskey='h' width='5'>`n",true);
                output("`n<input type='submit' class='button' value='Transfer'></form>",true);
                output("<script language='javascript'>document.getElementById('amount').focus();</script>",true);
                addnav("",$return."&who=".$who."&stage=2");
            break;

            case "2":
                $amt = abs((int)$_POST['amount']);
                $type = $_POST['type'];
                output("`6`bTransfer Completion`b`n");
                switch ($type) {
                    case "gold":
                        if ($ThisGuild['gold']<$amt){
                            output("`6How can you transfer `^$amt`6 gold when you only possess ".($ThisGuild['gold'])."`6?");
                        }else{
                            debuglog(" `&from the ".$ThisGuild['Name']." transferred ".$amt." gold to ".$MemberName,$who);
                            $ThisGuild['gold']-=$amt;
                            if ($who==$session[user][acctid]){
                               $session[user][gold]+=$amt;
                            }else{
                            $sql= "update accounts set gold=gold+".$amt." where acctid=".$who;
                            db_query($sql);
                           }
                            update_guild_info($ThisGuild);
                            output("`6Transfer Completed!");
                        }
                    break;
                    case "gems":
                        if ($ThisGuild['gems']<$amt){
                            output("`6How can you transfer `%$amt`6 gems when you only possess ".($ThisGuild['gems'])."`6?");
                        }else{
                            debuglog("`& from the ".$ThisGuild['Name']." transferred ".$amt." gems to ".$MemberName,$who);
                            $ThisGuild['gems']-=$amt;
                            if ($who==$session[user][acctid]){
                               $session[user][gems]+=$amt;
                            }else{
                            $sql= "update accounts set gems=gems+".$amt." where acctid=".$who;
                            db_query($sql);
                           }
                            update_guild_info($ThisGuild);
                            output("`6Transfer Completed!");
                        }

                    break;
                }
                break;
            }

}

that should be it.... hopefully I didn't miss anything...
Logged
FW Viper
Guest
« Reply #3 on: April 23, 2004, 07:19:21 AM »

I dunno I can't figer it out, the person who creats the guild still has no control over it.

check it out and see if I maybe forgot to add something.
http://hfs.cjb.net/games/LoGD/demo/LoGD/

sorce is viewable on my test server.
Logged
lonnyl
Guest
« Reply #4 on: April 23, 2004, 07:39:59 AM »

ok more changes... to better display stats for those who are not in a clan.

in common.php change this section to... (changes noted with -->)

// Guilds Code, Dasher
        $guildName=$session['guilds'][$u['guildID']]['Name'];
       --> if ($guildName=="") $guildName="None";
        $guildDisplayRank=FindRankForPerson($u['guildID'],$u['acctid'],false);
       --> if ($guildDisplayRank=="Bugger" or $guildDisplayRank=="") $guildDisplayRank="None";
        // End Guilds Code
Logged
lonnyl
Guest
« Reply #5 on: April 23, 2004, 07:41:53 AM »

I also wanted to add..... that IMHO the clans links should just be dropped and keep this mod as a guild code..... What do you all think?   Of course it is up to Dasher as he is the one coding this...... Just my opinion.  Grin
Logged
FW Viper
Guest
« Reply #6 on: April 23, 2004, 07:47:29 AM »

I think guilds and clans are kind of simmeler, some server might want to run clans and not guilds.

It would depend on the feel of the comunity.

you can simply edit out the one you don't want to run or run them both.
Logged
FW Viper
Guest
« Reply #7 on: April 23, 2004, 07:54:45 AM »

small flaw the guild creater starts out with the lowest rank and when I try and change it to 'leader' it sets it to blank (or in if you made lonnyl latest moddification to the script 'none')
Logged
FW Viper
Guest
« Reply #8 on: April 23, 2004, 07:59:47 AM »

I get the following error when updateing the guild

Array ( [ID] => 6 [Name] => The First [GuildPrefix] => Array (
 => 1 [display] => one ) [PublicText] => blah [ApplyText] => blah [RulesText] => blah [ExternalPagesLink] => http://hfs.cjb.net/ [Hitlist] => None [gold] => 10000 [gems] => 50 [SitePoints] => 0 [GuildLeader] => 18 [BadLanguage] => [MissingVitalInfo] => )

I seem to get the same error dering guild creation. the page still loads and the game moves on fine however it seems to drop the [display] tag and it don't get entered. (or at lest I can't see it.) the badlanguage filter on my server is of would that effect it?
Logged
FW Viper
Guest
« Reply #9 on: April 23, 2004, 08:01:51 AM »

the display seems to show now, but I still get the error.
Logged
lonnyl
Guest
« Reply #10 on: April 23, 2004, 08:10:19 AM »

update the the display fix I posted earlier.... this should fix the leader displays.

// Guilds Code, Dasher
        $guildName=$session['guilds'][$u['guildID']]['Name'];
        if ($guildName=="") $guildName="None";
        $guildDisplayRank=FindRankForPerson($u['guildID'],$u['acctid'],false);
        if ($guildDisplayRank=="Bugger" or $guildDisplayRank==""){
           if ($session[user][guildrank]<>0){
              $sql="select DisplayTitle from lotbd_guildranks where RankID=".$session[user][guildrank];
              $result=db_query($sql);
              $row = db_fetch_assoc($result);
              $guildDisplayRank=$row['DisplayTitle'];
              //$guildDisplayRank="None";
           }else{
           $guildDisplayRank="None";
        }
        }
        // End Guilds Code
Logged
FW Viper
Guest
« Reply #11 on: April 23, 2004, 08:30:40 AM »

One difranse from what I have and what you have would it make any diffranse?

Code:
          // Guilds Code, Dasher
           $guildName=$session['guilds'][$u['guildID']]['Name'];
      if ($guildName=="") $guildName="None";
           $guildDisplayRank=FindRankForPerson($u['guildID'],$u['acctid'],false);
      if ($guildDisplayRank=="Bugger" or $guildDisplayRank==""){
      if ($session[user][guildrank]<>0){
         $sql="select DisplayTitle from lotbd_guildranks where RankID=".$session[user][guildrank];
         $result=db_query($sql);
         $row = db_fetch_assoc($result);
         $guildDisplayRank=$row['DisplayTitle'];
      //$guildDisplayRank="None";
      }else{
      $guildDisplayRank="None";
      }
      }
           // End Guilds Code

Code:
$guildName=$session['guilds'][$u['guildID']]['Name'];
Logged
lonnyl
Guest
« Reply #12 on: April 23, 2004, 08:33:05 AM »

go to view shared files and aseekr there was a new version posted there and you may not have that.... (or an update I should say.)
Logged
FW Viper
Guest
« Reply #13 on: April 23, 2004, 08:59:27 AM »

after makeing them changes the code I origenly posted here remains unchanged + now I can't get to the guild-clans.php page even after makeing the changes posted here.

(page loads blank)
Logged
lonnyl
Guest
« Reply #14 on: April 24, 2004, 05:23:18 AM »

bio.php change to get rank to display....

after
output("`^Bio: `@`n".soap($row['bio'])."`n");
you will have the section to display the guild info change it to:

// Guilds/Clans Change
if ($row['guildID']!=0) {
    Require_once("guildclanfuncs.php");
    $ThisGuild=$session['guilds'][$row['guildID']];
    $GuildName=$ThisGuild['Name'];
    $PublicText=$ThisGuild['PublicText'];
     $sql2="select DisplayTitle from lotbd_guildranks where RankID='".$row['guildRank']."'";
              $result2=db_query($sql2);
              $row2 = db_fetch_assoc($result2);
              $Rank=$row2['DisplayTitle'];
    output("`^Guild: `@".$ThisGuild['Name']."`n",true);
    output("`^Rank in Guild: `@".$Rank."`n",true);
    output("`^Guild Motto: `@".$PublicText."`n`n");
}
// End Guilds/Clans Change

Your ranks should now display on the bio page.
Logged
Pages: [1] 2 3 ... 8   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
61 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search