Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 PhotoAlbum 1.80 MOD Add-ON - Dynamic Upload Limit
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jfitz
Junior Member

USA
345 Posts

Posted - 17 August 2003 :  14:28:08  Show Profile
PHOTO ALBUM 1.80 SUPPLEMENTAL MOD - USER LEVEL DYNAMIC UPLOAD LIMIT
Initial Post: 17 Aug 2003

This MOD is an ADD-ON change to the Photo Album 1.80 MOD by Berthold, with whose permission it is being posted.

This change to the photo album mod increases the number of allowed photos as the member gains more stars. It is currently set to allow 10 * the number of stars, but you can change the calculation to any value you like. It requires a three simple additions to a single file :PHOTO_ALBUM_UPLOAD.ASP

Level of Difficulty (1-10 scale, 10 most difficult): 2

PHOTO_ALBUM_UPLOAD.ASP

1. Find the following lines (around line 81):

ucnt = My_Conn.execute(strSql)
M_ID = ucnt("Member_id")

and add these lines immediately following

'## MOD STARS PHOTO LIMIT
strSql = "select M_POSTS from " & strTablePrefix & "MEMBERS where Member_ID=" & M_ID
cnt = My_Conn.execute(strSql)
post_cnt = cnt("M_POSTS")
post_cnt = cint(post_cnt)
'CHANGE THE FOLLOWING LINE TO ADJUST THE UPLOAD LIMIT FORMULA
post_lmt = 10 * getMember_StarCount(post_cnt)


2. Find the following lines (around line 95)

strSql = "select * from "& strTablePrefix & "ALBUM_CONFIG"
strConf = My_Conn.execute(strSql)
num_files = trim(strConf("num_files"))
num_files = cint(num_files)

and add these lines immediately following

'## MOD STARS PHOTO LIMIT
if num_files < post_lmt then
  num_files = post_lmt
end if

3. At the end of the file, find this line

call WriteFooter

and add these lines following, and before the %> at the end of the file.

Note that this routine is compatible with my Additional Ranks MOD, but that mod is NOT required for this mod to work properly.

'## MOD STARS PHOTO LIMIT
function getMember_StarCount (mposts)
  if (mposts >= cLng(intRankLevelA)) and (cLng(intRankLevelA) > 0) then 
    getMember_StarCount = 10
  elseif (mposts >= cLng(intRankLevel9)) and (cLng(intRankLevel9) > 0) then 
    getMember_StarCount = 9
  elseif (mposts >= cLng(intRankLevel8)) and (cLng(intRankLevel8) > 0) then 
    getMember_StarCount = 8
  elseif (mposts >= cLng(intRankLevel7)) and (cLng(intRankLevel7) > 0) then 
    getMember_StarCount = 7
  elseif (mposts >= cLng(intRankLevel6)) and (cLng(intRankLevel6) > 0) then 
    getMember_StarCount = 6
  elseif mposts >= cLng(intRankLevel5) then 
    getMember_StarCount = 5	
  elseif mposts >= cLng(intRankLevel4) then 
    getMember_StarCount = 4
  elseif mposts >= cLng(intRankLevel3) then 
    getMember_StarCount = 3
  elseif mposts >= cLng(intRankLevel2) then 
    getMember_StarCount = 2
  elseif mposts >= cLng(intRankLevel1) then 
    getMember_StarCount = 1
  else getMember_StarCount = 0
  end if
end function


Upload the revised file, and you're done!

--Jördan
It's a wasted day if you don't spend at least part of it flying upside down.
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07