Guest askjames01 Posted April 29, 2006 Share Posted April 29, 2006 include("lang/".$mg2->defaultlang);ok, let me first try to explain itis this include fetch the value from the variable defaultlang? right?and put the inheritance into Class Object ('$mg2')? right?and defaultlang variable can be found inside a class and under a function? right?please correct me if i'm wrong?thanks.-/james/ Quote Link to comment Share on other sites More sharing options...
Guest askjames01 Posted April 30, 2006 Share Posted April 30, 2006 *bump*so what is the period all about in the front of $?i checked the directory /root/lang/ and it has only a file namely english.phpis this line of code call the file english.php, because i'm so confused.if you read the code --> include("lang/".$mg2->defaultlang); it does not indicate a filenameso maybe i assume that it is indicating the english.php which is the only file that residingfrom the directory.then if that is the case then what will happen if there are more than one files?using the said code?ok here are the english.php codes:[code]// CHARSET INFORMATION$mg2->charset = "utf-8";//GALLERY LANGUAGE STRINGS$mg2->lang['gallery'] = "Gallery";$mg2->lang['of'] = "of";$mg2->lang['first'] = "First";$mg2->lang['prev'] = "Previous";$mg2->lang['next'] = "Next";$mg2->lang['last'] = "Last";$mg2->lang['thumbs'] = "Thumbs";$mg2->lang['exif info'] = "Exif Information";$mg2->lang['model'] = "Model";$mg2->lang['shutter'] = "Shutter speed";$mg2->lang['viewslideshow'] = "View slideshow";$mg2->lang['stopslideshow'] = "Stop slideshow";$mg2->lang['aperture'] = "Aperture";$mg2->lang['flash'] = "Flash";$mg2->lang['focallength'] = "Focal length";$mg2->lang['mm'] = "mm";$mg2->lang['exposurecomp'] = "Exposure compensation";$mg2->lang['original'] = "Original";$mg2->lang['metering'] = "Metering";$mg2->lang['iso'] = "ISO";$mg2->lang['seconds'] = "s";$mg2->lang['page'] = "Page";$mg2->lang['all'] = "All";$mg2->lang['fullsize'] = "View fullsize image";$mg2->lang['addcomment'] = "Add comment";$mg2->lang['name'] = "Name";$mg2->lang['email'] = "Email";$mg2->lang['commentadded'] = "Comment added";$mg2->lang['commentexists'] = "ERROR: Comment already exists!";$mg2->lang['commentmissing'] = "ERROR: All comment fields must be filled!";$mg2->lang['enterpassword'] = "Enter password";$mg2->lang['thissection'] = "This section is password protected";// ADMIN LANGUAGE STRINGS$mg2->lang['root'] = "Root";$mg2->lang['thumb'] = "Thumb";$mg2->lang['dateadded'] = "Date added";$mg2->lang['upload'] = "Upload files";$mg2->lang['import'] = "Import uploaded files to";$mg2->lang['newfolder'] = "New folder";$mg2->lang['viewgallery'] = "View gallery";$mg2->lang['setup'] = "Setup";$mg2->lang['logoff'] = "Log off";$mg2->lang['menutxt_upload'] = "Upload";$mg2->lang['menutxt_import'] = "Import";$mg2->lang['menutxt_newfolder'] = "New folder";$mg2->lang['menutxt_viewgallery'] = "View gallery";$mg2->lang['menutxt_setup'] = "Setup";$mg2->lang['menutxt_logoff'] = "Logoff";$mg2->lang['delete'] = "Delete";$mg2->lang['cancel'] = "Cancel";$mg2->lang['ok'] = "Ok";$mg2->lang['deletefolder'] = "Delete folder";$mg2->lang['navigation'] = "Navigation";$mg2->lang['images'] = "image(s)";$mg2->lang['filename'] = "Filename";$mg2->lang['title'] = "Title";$mg2->lang['description'] = "Description";$mg2->lang['setasthumb'] = "Set as folder thumb";$mg2->lang['editfolder'] = "Edit folder";$mg2->lang['editimage'] = "Edit image";$mg2->lang['nofolderselected'] = "No folder selected";$mg2->lang['foldername'] = "Folder name";$mg2->lang['newpassword'] = "New password";$mg2->lang['deletepassword'] = "Delete password";$mg2->lang['introtext'] = "Intro text";$mg2->lang['deletethumb'] = "Delete thumb";$mg2->lang['moveto'] = "Move to";$mg2->lang['id'] = "Id";$mg2->lang['filesize'] = "Filesize";$mg2->lang['width'] = "Width";$mg2->lang['height'] = "Height";$mg2->lang['date'] = "Date";$mg2->lang['ascending'] = "Ascending";$mg2->lang['descending'] = "Descending";$mg2->lang['newfolder'] = "New folder";$mg2->lang['password'] = "Password";$mg2->lang['direction'] = "Direction";$mg2->lang['sortby'] = "Sort by";$mg2->lang['gallerytitle'] = "Gallery title";$mg2->lang['adminemail'] = "Admin email";$mg2->lang['language'] = "Language";$mg2->lang['skin'] = "Skin";$mg2->lang['dateformat'] = "Date format";$mg2->lang['DDMMYY'] = "DD MMM YYYY";$mg2->lang['MMDDYY'] = "MMM DD, YYYY";$mg2->lang['MM.DD.YY'] = "MM.DD.YY";$mg2->lang['DD.MM.YY'] = "DD.MM.YY";$mg2->lang['YYYYMMDD'] = "YYYYMMDD";$mg2->lang['sendmail'] = "Send comment emails";$mg2->lang['foldericons'] = "Force folder icons";$mg2->lang['showexif'] = "Show Exif";$mg2->lang['allowcomments'] = "Allow comments";$mg2->lang['copyright'] = "Copyright notice";$mg2->lang['passwordchange'] = "Change password (3 x blank = keep current)";$mg2->lang['oldpasswordsetup'] = "Enter current password";$mg2->lang['newpasswordsetup'] = "New Password (blank = use current)";$mg2->lang['newpasswordsetupconfirm'] = "Enter new password again";$mg2->lang['advanced'] = "Advanced";$mg2->lang['allowedextensions'] = "Allowed extensions";$mg2->lang['imgwidth'] = "Max. image width (0 = disable)";$mg2->lang['indexfile'] = "Gallery index file";$mg2->lang['thumbquality'] = "Thumbnail quality";$mg2->lang['image'] = "Image";$mg2->lang['edit'] = "Edit";$mg2->lang['editcurrentfolder'] = "Edit current folder";$mg2->lang['deletecurrentfolder'] = "Delete current folder";$mg2->lang['by'] = "by";$mg2->lang['loginagain'] = "Login again";$mg2->lang['securitylogoff'] = "Security logoff";$mg2->lang['autologoff'] = "You have been automatically logged off after 15 minutes of inactivity.";$mg2->lang['logoff'] = "Log off";$mg2->lang['forsecurity'] = "For security reasons, it is recommended to close this browser window.";$mg2->lang['updatesuccess'] = "Update successful";$mg2->lang['renamefailure'] = "ERROR: Filename contains illegal characters!";$mg2->lang['filedeleted'] = "File deleted";$mg2->lang['filenotfound'] = "File not found!";$mg2->lang['filesimported'] = "file(s) imported";$mg2->lang['nofilestoimport'] = "ERROR: No files to import!";$mg2->lang['foldernotempty'] = "ERROR: Folder not empty!";$mg2->lang['folderdeleted'] = "Folder deleted";$mg2->lang['folderupdated'] = "Folder updated";$mg2->lang['foldercreated'] = "Folder created";$mg2->lang['folderexists'] = "ERROR: Folder name exists!";$mg2->lang['filesuploaded'] = "File(s) uploaded - Importing...";$mg2->lang['settingssaved'] = "Settings saved";$mg2->lang['nopwdmatch'] = "Settings saved<br /><br />ERROR: Password mismatch - new password not saved!";$mg2->lang['filesmovedto'] = "file(s) moved to";$mg2->lang['filesdeleted'] = "file(s) deleted!";$mg2->lang['file'] = "file";$mg2->lang['files'] = "files";$mg2->lang['folder'] = "folder";$mg2->lang['folders'] = "folders";$mg2->lang['rebuild'] = "Rebuild";$mg2->lang['rebuildimages'] = "Rebuild thumbnails";$mg2->lang['rebuildsuccess'] = "Rebuild completed";$mg2->lang['donate'] = "MG2 is free software, licensed under the GPL. If you find this software useful, please make a donation to the author by pressing the button below.";$mg2->lang['from'] = "From";$mg2->lang['comment'] = "Comment";$mg2->lang['comments'] = "Comments";$mg2->lang['by'] = "by";$mg2->lang['commentsdeleted'] = "Comment(s) deleted";$mg2->lang['buttonmove'] = "Move";$mg2->lang['buttondelete'] = "Delete";$mg2->lang['deleteconfirm'] = "Delete selected files?";$mg2->lang['imagecolumns'] = "Image columns";$mg2->lang['imagerows'] = "Image rows";$mg2->lang['viewfolder'] = "View folder";$mg2->lang['viewimage'] = "View image";$mg2->lang['viewgallery'] = "View gallery";$mg2->lang['rotateright'] = "Rotate 90 degrees right";$mg2->lang['rotateleft'] = "Rotate 90 degrees left";$mg2->lang['imagerotated'] = "Image rotated!";$mg2->lang['gifnotrotated'] = "ERROR: .GIF files can't be rotated due to limitations in GD lib!";$mg2->lang['help'] = "Help";$mg2->lang['slideshowdelay'] = "Slideshow delay";$mg2->lang['websitelink'] = "Website link (blank = disable)";$mg2->lang['marknew'] = "Mark items newer than X days (0 = disable)";$mg2->lang['folderempty'] = "This folder is empty";$mg2->lang['noimage'] = "The requested image does not exist!";// ----8<--------------------------------// INSTRUCTIONS 0.5.0//// 1. Remove the following lines from above:// $mg2->lang['uploadimport']// $mg2->lang['upgradenote']//// 2. Update the translations for the following strings:// $mg2->lang['filesuploaded']//// 3. Add the lines below into your existing translation// 4. Translate the lines you just inserted into your own language file// 5. Remove this comment// 6. Update the 'last updated' comment in beginning of file// 7. Upload the new language file to the addon directory (www.minigal.dk/login.php)//// (If you don't have a login, send a mail to support@minigal.dk)// ----8<--------------------------------$mg2->lang['actions'] = "Actions";$mg2->lang['backupcomplete'] = "Database backup complete";$mg2->lang['backuplink'] = "Make database backup";$mg2->lang['viewlogfile'] = "View logfile";$mg2->lang['website'] = "To website";$mg2->lang['version1'] = "You have the latest MG2 version";$mg2->lang['version2'] = "MG2 version X is available!";$mg2->lang['version3'] = "Error: You seem to have a version newer than the one online!";$mg2->lang['goto'] = "Goto";$mg2->lang['backtofolder'] = "Back to folder";$mg2->lang['permerror1'] = "PERMISSION ERROR: Cannot write to gallery root folder!";$mg2->lang['whattodo1'] = "Chmod your gallery folder to 777";$mg2->lang['permerror2'] = "PERMISSION ERROR: Cannot write to 'pictures' folder!";$mg2->lang['whattodo2'] = "Chmod your 'pictures' folder to 777";$mg2->lang['permerror3'] = "PERMISSION ERROR: Cannot write to 'mg2db_idatabase.php' file!";$mg2->lang['whattodo3'] = "Chmod 'mg2db_idatabase.php' file to 777";$mg2->lang['permerror4'] = "PERMISSION ERROR: Cannot write to 'mg2db_idatabase_temp.php' file!";$mg2->lang['whattodo4'] = "Chmod 'mg2db_idatabase_temp.php' file to 777";$mg2->lang['permerror5'] = "PERMISSION ERROR: Cannot write to 'mg2db_fdatabase.php' file!";$mg2->lang['whattodo5'] = "Chmod 'mg2db_fdatabase.php' file to 777";$mg2->lang['permerror6'] = "PERMISSION ERROR: Cannot write to 'mg2db_fdatabase_temp.php' file!";$mg2->lang['whattodo6'] = "Chmod 'mg2db_fdatabase_temp.php' file to 777";?>[/code]so what do you think my explaination above? is it all wrong or some how right? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 30, 2006 Share Posted April 30, 2006 This code line: [code]<?php include("lang/".$mg2->defaultlang); ?>[/code]Has this meaning (and this meaning only)Include the file that has the name that is equal to the string created by appending the string in "$mg2->defaultlang" onto "lang/".The period in PHP is the concatenation operator. See the manual section on [a href=\"http://us2.php.net/manual/en/language.operators.string.php\" target=\"_blank\"]string operators[/a].If you want to see what file is being included, put this line[code]<?php echo 'lang/' . $mg2->defaultlang . '<br>'; ?>[/code]before the include.Ke Quote Link to comment Share on other sites More sharing options...
Guest askjames01 Posted April 30, 2006 Share Posted April 30, 2006 nice answer [b]kenrbnsn[/b]thanks brother. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.