News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

CountryFlags

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

Previous topic - Next topic

Sabre™

Quote from: shelzmike on August 05, 2008, 01:50:15 PM
Quote from: neil h on May 26, 2008, 03:46:28 AM
When I tried to install the package, I got this in a warning box:
Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Below in the files list, this comes up:
Quote
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

The only other mod I have running is Ad Management 2.3

My version is SMF 1.1.5

Anyone know why this is happening?


Did this ever get resolved? I am getting the same error. Would it possibly be due to file permission issues? Thanks.

Mike

Have you tried manually installing the mod?
When there is only one installation error as youve shown, I back that template up, install the mod,  then add the needed code to that template myself.
Use a [PACKAGE PARSER] to install the missing code.
Just upload the mod there, select your smf version, then send file.
You will see all the code added to your templates, but look for the template you need to modify.

There is also the option to ONLY show the files you need to modify in a custom theme.

Hope this helps.
Enjoy :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


CraigPal

#461
Does anyone know if this mod will be adapted for use in 2.0?

Thanks again,

Craig

____________
Raw Paleo Diet Group

Aeoni

I took this mod off my site for around 30 seconds while i fixed something else.

And someone registered...

How can I manually add a flag to someone? There's nothing in the admin section, and they can't do it via profile.

Thanks! :)

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

Sabre™

There should be an area in your  Features and Options  section in your Admin panel.
In the  Basic Features  tab, scroll all the way down the bottom of the page, and you should see your flag options there.
The  Ask for country flag on  drop down is where you select to show the flag options on Registry and/or on the profile.
Select the profile for now, or keep it on both if you like, then go to their profile and select one.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Aeoni

I've checked that. I have selected 'Profile', and the I tried 'Both'

There's nothing in the users profile which lets me choose a flag.

The profile looks like:

Avatar Select
Birthdate
Location (just an input field - not the flag one)
Gender
ICQ,YIM etc
Custom Title
Sig
Website Title - URL
Karma

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

Sabre™

Are you using a custom theme, or the default?
If you are not using the default theme, you will have to manually install the  profile.template.php  edits, to your custom themes  profile.template.php.

Use a [PACKAGE PARSER] to assist you with manual edits.
1.) Click browse, and upload the mod package to it
2.) Select your SMF version
3.) Select   "Only Theme edits"  then press send file.

This will show you all the edits needed for custom themes.

Good Luck  :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Aeoni

#466
Nice advice, but:

ERROR: The package-info.xml file is invalid!

Debugging Information
Error message: String could not be parsed as XML
Source: /home/sleepy1/public_html/PackageParser/index.php:184
Errors encountered while parsing XML file:
Stack Trace:
#0 /home/sleepy1/public_html/PackageParser/index.php(184): SimpleXMLElement->__construct('')
#1 /home/sleepy1/public_html/PackageParser/index.php(125): parsePackageInfoXML('/home/sleepy1/b...', 'install', 'theme')
#2 /home/sleepy1/public_html/PackageParser/index.php(823): parseArchive('/tmp/phpiMPzEC', 'install', 'theme')
#3 {main}

XML File:


As a side note, I'm using the theme 'Adagio' by Bloc, available at TinyPortal.net, and possibly other places.
The mod is made for SMF Versions: 1.1 RC2, 1.1 RC3, 1.1, 1.1.2 (but it works with 1.1.4, and 1.1.5...normally)

I'm using 1.1.5

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

Sabre™

Ok.
The package parser/mods have that issue sometimes.

Click [here], and look to your right, underneath  "Download this mod".
Use the dropdown box below  "Manual Install Instructions for SMF"  to select your SMF version, then click on submit.

Anything that has  "DEFAULT"  in it, you will need to do the manual edits for, if your custom theme also has that template.
eg.  ./Themes/default/Profile.template.php  or   ./Themes/default/Register.template.php
If your theme doesnt have that template, then you do not need to make those edits, as it will use that template in the default them folder.

I could put the code here for you to copy n paste, but the benefits of you lookin and working through it at an early stage, will be very beneficial for yourself wit future edits.

Remember: Try to backup your forum as often as you can.
If youre manually editing a single template at a time, then back that template up first!

Good luck mate :)
And if any problems occur, someone is always around to help :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Aeoni

#468
*Starts to edit*

OK. Modification.english.php already had the code... *leaves it alone*

*scratches head*

My theme has the following files:

help.css
index.php
index.template.php
settings.template.php
style.css
theme_info.xml
themes.template.php



Therefore, according to your instructions, I don't need to make a single edit....

So it's still broken....

:(

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

Sabre™

Did you check to see if the code was in the default profile template?
If it had been inserted correctly upon install.
Any errors in your error log?
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Aeoni

My error log has around 10 pages of errors per hour... Which really get's on my nerves.... But nothing that relates to this mod.

display.template.php has the code inserted already...
profile.template.php did NOT have the code. Code added...
register.template.php did NOT have the code. Code added...

*upload*


Parse error: syntax error, unexpected '<' in .../Themes/default/Profile.template.php on line 1718

1709: // Show age only
1710: echo implode('-', $context['member']['birth_date']);
1711: }
1712: echo '
1713: </td>
1714: </tr><tr>
1715: <td width="40%"><b>', $txt[227], ': </b></td>
1716: <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td> </tr>'; // If flags is set for registration show it. if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3) { // Call the function that has all the flag info $flags = CountryFlag(); echo ' <script language="JavaScript" type="text/javascript"> function showflags() { document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\'; } </script> <tr> <td width="40%" align="top"> <b>', $txt['country_flag_label'], ':</b> </td> <td> <select name="country" onchange="showflags()"> <option value=""></option>'; // Loop and show the drop down. foreach ($flags as $key => $name) echo ' <option value="', $key, '" ', isset($context['member']['options']['country']) && $context['member']['options']['country'] == $key ? 'selected="selected"' : '', '>', $name, '</option>'; echo ' </select> <img id="flags" src="', $settings['default_theme_url'], '/images/', isset($context['member']['options']['country']) && !empty($context['member']['options']['country']) ? 'flags/' . $context['member']['options']['country'] . '.png': 'blank.gif', '" width="25" height="15" align="top" /> </td> </tr>'; } echo ' <tr> <td width="40%"><b>', $txt[231], ': </b></td>
1717:
1718: <td>';1719: if($context['user']['is_admin'] || !isset($context['member']['gender']['name']))
1720: {
1721:


*uploads originals*

No. That didn't seem to work either...?

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

Sabre™

#471
10 pages of errors an hour?

Whenever you make any change to the structure of your forum(install a mod etc), you should always check your error log. If you see an error directly after a change, immediately seek to fix it.
If it occurs directly after installing a mod, then seek assistance from that mod creator.
A problem left to sit, could possibly contribute to another error.. etc etc

The issue I see with your code above, is that you have inserted the code as one line, instead of its structure as in the frontpage parser.
This could be due to that parser copying as one line.
You must do the leg work, and adjust the code to how it is displayed there.

For example:
It asks you to replace this in the profile template
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>


with this

<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>';

// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.gif\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">


If you copy n paste from the parser where you get the mod, it will come out like this
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td> </tr>'; // If flags is set for registration show it. if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3) { // Call the function that has all the flag info $flags = CountryFlag(); echo ' <script language="JavaScript" type="text/javascript"> function showflags() { document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\'; } </script> <tr> <td width="40%" align="top"> <b>', $txt['country_flag_label'], ':</b>

And wont work.

For manual edits, you must get the characters on each line correct to how it is displayed.
You are doing good in attempting this, now try and finish it. :)
Ive done the first bit for you above, there is one more edit for your profile template.
Add the above, and the final edit, and thats your profile template complete.

I suggest you work through the errors in your log also :-\

Good luck :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Aeoni

 :D <--- see that? It's as near to my face as I can get right now. Apart from the yellowness...

I copied everything from the parser that relied on default templates, then instead of pasting it into the PHP file, as I'd been doing, I pasted it into a new text document. It kept the same formatting as was displayed, so from there I copied it to the PHP file.

Uploaded.

Ta-Da!

It worked. I added the flag through the users profile, went to check a post he'd made, and sure enough, the flag was there.

2 of them....   >:(

I figured if I uploaded ONLY the profile.template it would be how it should be.

And it was. Everyone has a flag on their post, everyone can select a flag at registration.

Many thanks Sabre. Was easy really......    :P

And as for the errors, many of them come from the TP code, I think. ADV Shoutbox provided me with hundreds of errors, as did the normal shoutbox. I took them off and will make do with 10 or so pages an hour  :D

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

Sabre™

lol
Hurrah!!!
Congratulations mate :)
Good job.

Ask the TP team to help you sift through your errors if you havent already.
Theyre a good group there, and will assist when time permits etc.

Im glad you sorted this issue out mate.
Once again..  congrats, and good job :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


spearfish

#474
Hey,
I've got a question concerning this mod - where exactly is the country each user selects stored at?  I couldn't find ANY database queries in the install.xml file.

Can somebody point out where these are stored?

Thanks!




Edit:
I've been able to find the values... disregard this post.

runebergen



How can I use this manually?

I want to add a code block to Simple Portal.. But not sure what includes or globals are needed...

Anyone got an idea ? :)

AlenNS

When this mod will be ready for SMF 2.0?

Abavagada

I've downloaded CountryFlag_1-0-2.tar.gz for use with SMF 1.1.6. When I try to upload, I am told:

An Error Has Occurred!
The package you tried to upload either is not a valid package or has become corrupted.

Has anyone else had this problem? I have tried redownloading it a few times.
Will I have to install this manually?

Thanks

minos

hi im having a trouble  i installed this mod on 1.1.6 and nothings wrong but not show de flag whhere post are shown even in the default theme , by  the way mi the doesnt have  displaye template

jen2swt

I installed this ok. Only thing I got an error on was the Modsettings.php which I did manually. Everything tested just fine.

Now, I don't have any options in the admin panel to select the use of this nor does it have any options in the profiles.

I am NOT using the default skin, using the DilberMC theme. There is no profile.template.php, and the profile-template.php for the default was changed accordingly.....

What shall I do? A little lost now.

Thanks

Advertisement: