News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

CountryFlags

Started by SMFHacks.com Team, August 14, 2006, 01:07:43 PM

Previous topic - Next topic

folkandfaith

any chance of an update soon to let us be able to change things in it?

softtouch

Any change to let it automatically select the flag based on the IP, like they do at the motorolafans.com forum?

brianjw

How is KGIII going to get the permissions to edit the module since only the member who created it can edit their mod?

TrueSatan

I can't see where I saw anything about it being taken over so ignore that (I may have muddled it with another mod) but in general a mod can be taken over by another developer if it's originator of the mod allows it to be done...and not if a third party makes a fuss asking for somebody to take over a mod without the originators permission.

KGIII

The same way I got TrimURL for instance. ;)

Anyhow... I will mull it over during this week and take a gander at the code some more. It may be viable but I have time limits to consider as well.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

TrueSatan

You'd be a better chouce for it than me if everything else were equal but if you don't have time etc I'll also consider it...and I'm all too well aware of how much time it can take to look after some of these mods.

Seeing as it really doesn't get said often enough...thanks for all you're doing...it is appreciated.

Marcus J

I have made a major mess up here.  I was installing the SMF arcade and somehow mulched many of my forums .php files.

I used the SMF parser and manually fixed all my problems.  However when I input the mod for country flags it tells me that it's not packaged properly.  I'm not here to argue about that though.  Because the mod was flawless before I made the mistake of not backing up before installing the arcade.  (Not bashing the arcade.  I should have made a backup)

The mod works, but I get this error.

Quote8: Undefined index: country_flag
File: /home/simju2/public_html/Forum/Themes/default/languages/Who.english.php (eval?)
Line: 269

Also I want to uninstall 1.01 and install 1.02.  However I can't do this right now.  I get this.
Quote
1.     Execute Modification     ./Sources/Register.php     Test successful
2.    Execute Modification    ./Sources/Subs.php    Test successful
3.    Execute Modification    ./Sources/ModSettings.php    Test successful
4.    Execute Modification    ./Sources/Profile.php    Test successful
5.    Execute Modification    ./Themes/default/Register.template.php    Test successful
6.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
7.    Execute Modification    ./Themes/default/Display.template.php    Test successful
8.    Execute Modification    ./Themes/babylon/Display.template.php    Test successful
9.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test failed

I know it's a lot to ask.  But can someone post the modifications the country flag mod makes.  Similar to how the parser does it?  If so I will gladly fix my mess up on my own.

Your humble, and now educated in the need for backing up before installing mods...

-Marcus

KGIII

Don't worry too much about the modifications.english.php really. I'm still way too busy. I have watched a lot of TrueSatan's posts and they may be an excellent choice for this one.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Marcus J

I wouldn't worry about it, but I don't want to uninstall the mod.  Only to reinstall and have everyone have to pick their flag again.  That's why I wanted the exact changes the package makes when uploaded and installed.  Also I get this (See attached pic)

A small thing, I know... but it drives me nuts!

TrueSatan

@ Mookey

My best advice to you, seeing as you say you have problems in a lot of your files, is to do a rather more complete and more certain repair.

Begin by backing up both your files and your database. With those backups in place you can reverse anything that comes next so you needn't be afraid to do the rest of these steps.

Delete your Themes, Sources and Packages directories...get a fresh copy of SMF 1.1.2 installer package and unzip it on your computer...from it replace the files on your server in the forum root with the exception of Settings.php and Settings_bak.php...don't alter these two files at all...this is very important. You don't need install.php from the package so don't add that either. Replace the three directories you deleted with the ones from the installer package.

This will give you a completely new installation of SMF 1.1.2 running on your existing database...you won't have lost any of your member's records or postings. You will, however, have removed all of the mods and themes you had installed.

You can now install the mods, themes or even code edits you want to use.

Doing it this way...a total clearout...will give you an installation that starts off again with a clean set of code that you can be sure won't have any left over residue from the problems you had. I know it sounds drastic but if you don't know what errors you had...and it sounded like that was the case...it is your safest solution.

Reading between the lines of your posting it sounds as though you don't know what went wrong in your arcade installation. I know you say you fixed all the files that were corrupted but the rest of your posting suggests there may be remaining issues on your forum....the above isn't a difficult thing to do, though it can take some of your time to get back to a forum with all the mods etc you want in place...it will give you a forum that is in good repair.

If you insist on continuing without doing the above then you could ignore the error reported by the package installer...as KGIII indicated it's isn't a major concern...and, if you wish though it won't do any harm if you don't do it, edit that file manually after the mod installation.

To edit the mod out of Themes/default/languages/Modifications.english.php find the following code and remove it:


// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';


@ KGIII

It sounds like I'm in the hot seat then...mind you I trust that you'll pipe up if I make any major mistakes.

Marcus J

TrueSatan, it might be time for a name change. ;)

You answered a question that I had only thought about asking.  That's exactly what I was looking for.  A clean forum, without losing any of my old posts!  Thank you!

I just have to sort out doing this with TinyPortal installed.  I have many files in the downloads section, and I don't want to lost them.  I will however seek support at the tinyportal site for this.

Combined with your help I'm sure things will be looking up soon.

Thanks again,

-Marcus

KGIII

TrueSatan:
http://www.simplemachines.org/community/index.php?topic=106060.msg1094961#msg1094961

You might want to see that topic. Then you could take 'ownership' of it and, yeah, I peek in on the various mod threads from time to time. Some of them exceed my knowledge though. ;)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

TrueSatan

@Mookey

The safest way for you to deal with your TP issue would be to have a test forum...get the files on that into an as new clean state...install TP onto that. The files there will now be fully edited for TP (obviously). You can then copy those files onto your main forum and as you already have the TP database changes made all should be OK...obviously you wouldn't overwrite the tp-downloads and tp-images directories and thus you'd preserve your existing files in those directories.

I expect you'll be told this on the TP forum but I thought it best to tell you here just in case...it's really far easier to do the process than it is to write a posting about it so don't be put off by my reams of text about it.

TrueSatan

Quote from: KGIII on June 10, 2007, 06:10:48 PM
TrueSatan:
http://www.simplemachines.org/community/index.php?topic=106060.msg1094961#msg1094961

You might want to see that topic. Then you could take 'ownership' of it and, yeah, I peek in on the various mod threads from time to time. Some of them exceed my knowledge though. ;)

Thanks...will do.

I'm not inclined to consider vast changes to it, what with v2.0 looming anyway, so I very much doubt that I'll honour requests for automatic flag selection by ip for instance...and those who want a Country Flags mod to provide other than country flags could easily replace the relevant images keeping the image names as before for their new images so I don't see a great need for new code there...mind you adding new items to the country array wouldn't be difficult on a one off custom basis...but then it wouldn't be a Country Flags mod if non country items were to be added to it...other than that I'll be glad to support those using or wanting to use this fine mod...and hope that all concerned will remember that the real thanks should go to the original author of it.

KGIII

2.0 final will be a ways away I expect.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Perochak

Please Give the Complete Code Change to make the Mod active in the Forum.

And name what files are required to change and where to change and what to change?

Thanks
Gain Knowledge,Try it, Modify it if you can and Spread it.

******************************************
www.vusr.net

TrueSatan

Please use:

http://server.daniel15.com/smf/package.php

...to give the details you need if you wish to add the mod manually...however it is best to use the SMF package installer unless there is a pressing reason not to do so.

brianjw

I have done this cool code modifying with this on my website and it works well. It makes it so the flag appears next to your username in posts.

Example: see screenshot

What to do -
Open the theme you want this on - display.template.php ~
Find

<b>', $message['member']['link'], '</b>';

Add After

// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" height="12px" width="20px" title="', $flags[$message['member']['options']['country']], '" /> <br />';
}


Awesome :)
Brianjw

TrueSatan

#318
Thanks Brian...it's pretty much a case of following the advice given in the SMF documentation http://docs.simplemachines.org/index.php?topic=402.msg531#msg531

BTW in answer to a request for automatic sensing of location and addition of flag according to that location...I did some work on this but found that it is far too often likely to give members the wrong flag. Areas such as Europe often have people in one country supplied from ISPs in another country and thus their ip numbers don't relate to their exact location. My own location is in the UK but my ip address sometimes can make it appear that I am in Denmark for instance.

hadesflames

update for 1.1.3 coming soon?

Advertisement: