View Full Version : YaBBSE mod
Dakle, stjecajem okolnosti, a i potreba napravio sam jedan mod za YaBBse forum...
Pa sad, bilo bi jako lijepo da netko (tko ima želju/volju/nešto treće) testira taj moj mod na svom YaBBse forumu..
Ovaj mod omogućava korisnicima da sami uploadaju svoj avatar na server..
Gdje ćete naći ovaj mod?!
Upravo ovdje...
sve je to OK, ali kada se otpakuje dobije se jedan txt file
sa ovim sadrzajem:
This is simple mod that enables users to upload their own avatar on profile.
Max size of avatar pictures you can change in Form Preferences and Settings or in Settings.php..
If you have some questions, be free to contact me on sh00le@email.hinet.hr
P.S. Sorry for my crappy english..
i jedan file sa extenzijom .mod koje moj comp otvara u winampu??????
ja ne vidim niti liniju koda?
mozda sam propustio shta??
Tek sad primijetih:
<id>
avatar_upload
</id>
<version>
1.0
</version>
<mod info>
This mod allows the users to upload their own pictures on the board.
</mod info>
<author>
Marijo Mihelcic
</author>
<homepage>
http://cs.gamer.hr
</homepage>
<edit file>
Sources/Profile.php
</edit file>
<search for>
global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$m odSettings,$language,$timeoffset;
</search for>
<add after>
global $max_pic_size;
</add after>
<search for>
<form action="$cgi;action=profile2" method="POST" name="creator">
</search for>
<replace>
<form enctype="multipart/form-data" action="$cgi;action=profile2" method="POST" name="creator">
</replace>
<search for>
closedir($dir);
$images = "";
</search for>
<add after>
$max_pic_size = $max_pic_size*1024;
</add after>
<search for>
<td width="45%"><font size="2"><B>$txt[475]</B></font></td>
<td><input type="checkbox" name="userpicpersonalcheck"$checked>
<input type="text" name="userpicpersonal" size="45" value="$tmp"></td>
</tr>
</search for>
<add after>
<tr>
<td width="45%"><font size="2"><B>$txt[up1]</B></font></td>
<td><input type="checkbox" name="userpicuploadcheck"$checked>
<input type="file" name="userpicupload" size="25" value="$tmp2">
<input type="hidden" name="MAX_FILE_SIZE" value="$max_pic_size"></td>
</tr>
</add after>
<search for>
global $usertitle,$REMOTE_ADDR, $userpic_width, $userpic_height;
</search for>
<add after>
global $facesdir, $max_pic_size;
</add after>
<search for>
if($member['userpic'] == "") { $member['userpic'] = "blank.gif"; }
</search for>
<add before>
//-------------- start of avatar mod
if( isset($member['userpicuploadcheck']) ) {
$name_of_pic = $_FILES['userpicupload']['name'];
$max_pic_size = $max_pic_size*1024;
if (!file_exists("$facesdir/$name_of_pic")) {
if ( ($_FILES['userpicupload']['size'] < $max_pic_size) AND (($_FILES['userpicupload']['type'] == "image/gif") OR ($_FILES['userpicupload']['type'] == "image/pjpeg"))) {
if (is_uploaded_file($_FILES['userpicupload']['tmp_name'])) {
$pic_size = $_FILES['userpicupload']['size'];
copy($_FILES['userpicupload']['tmp_name'], "$facesdir/$name_of_pic");
$member['userpic'] = $name_of_pic;
}
}
}
}
$sizes = @getimagesize($member['userpic']);
if ($sizes)
{
if (($sizes[0] > $userpic_width && $userpic_width != 0) ||
($sizes[1] > $userpic_height && $userpic_height != 0))
fatal_error("$txt[yse227] $userpic_width x $userpic_height)");
}
//-------------- end of avatar mod
</add before>
<edit file>
Settings.php
</edit file>
<search for>
########## MemberPic Settings ##########
</search for>
<add before>
########## Upload Pictures Settings ##########
$max_pic_size = 20; # Size of users avatars in KB
</add before>
<edit file>
Sources/Admin.php
</edit file>
<search for>
global $GodPostNum,$userpic_width,$userpic_height,$userpi c_limits,$yytitle,$mtxt,$mtitle,$mmessage;
</search for>
<add after>
global $max_pic_size;
</add after>
<search for>
<td class="windowbg2" bgcolor="$color[windowbg2]"><font size="2">$txt[591]</font></td>
<td class="windowbg2" bgcolor="$color[windowbg2]"><input type="text" name="godmem" size="5" value="$GodPostNum"></td>
</tr><tr>
<td colspan=2 class="windowbg2" bgcolor="$color[windowbg2]">
<HR size="1" width="100%" class="windowbg3"></td>
</tr>
</search for>
<add after>
<tr>
<td class="windowbg2" bgcolor="$color[windowbg2]"><font size="2">$txt[up2]</font></td>
<td class="windowbg2" bgcolor="$color[windowbg2]"><input type="text" name="max_av_size" size="5" value="$max_pic_size"></td>
</tr><tr>
<td colspan=2 class="windowbg2" bgcolor="$color[windowbg2]">
<HR size="1" width="100%" class="windowbg3"></td>
</tr>
</add after>
<search for>
$color['fadertext2'] = isset($HTTP_POST_VARS['fadertext2']) ? $HTTP_POST_VARS['fadertext2'] : '#000000';
</search for>
<add after>
$max_avatar_size = isset($HTTP_POST_VARS['max_av_size']) ? $HTTP_POST_VARS['max_av_size'] : 20;
</add after>
<search for>
########## MemberPic Settings ##########
</search for>
<add before>
########## Upload Pictures Settings ##########
\$max_pic_size = $max_avatar_size; # Size of picture in KB
</add before>
<edit file>
english.lng
</edit file>
<search for>
$englishlngver="YaBB SE 1.4.1";
$locale = "en_US";
</search for>
<add after>
$txt['up1'] = "Upload own picture";
$txt['up2'] = "Max size of users avatars in KB";
</add after>
zasto .mod extenzija?????
btw. sutra cu ga testirati! :njam:
Zato što je to mod za yabb forum, a oni imaju nastavke .mod.. :)
Pokušao sam taj mod zapakirati u yabb pack, međutim tako se ne žali instalirati. Tj. ne promijene se one 4 datoteke koje bi se trebalo promijeniti...
(ako želiš mogu ti poslati i taj pak :) )...
No, ovo je samo test verzija, prije nego što instaliraš ovaj mod u svakom slučaju napravi backup...
Evo i nove verzije..
U ovoj verziji se veličina avatara u KB mijenja u dijelu settingsa vezanih za MODove, a ne za forum..
Avatar Upload 1.01 (http://www.istudio.org/forum/Packages/avatar_upload_v1.01.zip)
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.