Advertisement:

Author Topic: [Tip&trick] Vb postbit  (Read 100353 times)

babjusi

  • Guest
[Tip&trick] Vb postbit
« on: July 31, 2008, 04:24:42 PM »
Recently I made this for someone here who asked me. It displays the post info at the topic view in a bordered way, vb style. Which I think it's a more organized look and will be effective in every post on your forum. That guy had seen it at another forum, not smf, and asked me to port it over to his smf forum as well. So, I did that and I thought to share it here as well.


Here we go.

First of all make a backup of the files before you apply the changes

Add the following set of code all the way to the bottom of the style.css file in your theme''s directory

Code: [Select]
.memdetails {
    padding-top: 3px;
    padding-right: 0px;
    padding-bottom: 3px;
    padding-left: 3px;
    margin: 3px 0px 3px 3px;
    background-color: #fafcfe;
    border-top: 1px solid #686868 ;
    border-right: 1px solid #686868 ;
    border-left: 3px solid #686868 ;
    border-bottom: 1px solid #686868;
}       

Save the changes and re-upload the file back overwriting the old one.

Next, upload the Display.template.php file from your /Themes/ directory  to your pc and open it with a decent php editor program and find the following code:

Code: [Select]
// Show the member's custom title, if they have one.
      if (isset($message['member']['title']) && $message['member']['title'] != '')
         echo '
                        ', $message['member']['title'], '<br />';


Change it to:

Code: [Select]
// Show the member's custom title, if they have one.
      if (isset($message['member']['title']) && $message['member']['title'] != '')
         echo '
                        <div class="memdetails">', $message['member']['title'], '</div>';


Find:

Code: [Select]
// Show the member's primary group (like 'Administrator') if they have one.
      if (isset($message['member']['group']) && $message['member']['group'] != '')
         echo '
                        ', $message['member']['group'], '<br />';


Change it to:

Code: [Select]
// Show the member's primary group (like 'Administrator') if they have one.
      if (isset($message['member']['group']) && $message['member']['group'] != '')
         echo '
                        <div class="memdetails">', $message['member']['group'], '</div>';


Find:

Code: [Select]
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
         if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
            echo '
                        ', $message['member']['post_group'], '<br />';
         echo '
                        ', $message['member']['group_stars'], '<br />';


Change it to:

Code: [Select]
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
         if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
            echo '
                        <div class="memdetails">', $message['member']['post_group'], '</div>';
         echo '
                        <div class="memdetails">', $message['member']['group_stars'], '</div>';



Find:

Code: [Select]
// Is karma display enabled?  Total or +/-?
         if ($modSettings['karmaMode'] == '1')
            echo '
                        <br />
                        ', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
         elseif ($modSettings['karmaMode'] == '2')
            echo '
                        <br />
                        ', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';

Change it to:

Code: [Select]
// Is karma display enabled?  Total or +/-?
         if ($modSettings['karmaMode'] == '1')
            echo '
                       
                        <div class="memdetails">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</div>';
         elseif ($modSettings['karmaMode'] == '2')
            echo '
                        <div class="memdetails">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</div>';


Find:

Code: [Select]
// Show online and offline buttons?
         if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
            echo '
                        ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';

Change it to:

Code: [Select]
// Show online and offline buttons?
         if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
            echo '
                        <div class="memdetails">', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /></div>';


Find:

Code: [Select]
// Show how many posts they have made.
         echo '
                        ', $txt[26], ': ', $message['member']['posts'], '<br />
                        <br />';


Change it to:

Code: [Select]
// Show how many posts they have made.
         echo '
                        <div class="memdetails">', $txt[26], ': ', $message['member']['posts'], '</div>';


Find:

Code: [Select]
// Show their personal text?
         if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
            echo '
                        ', $message['member']['blurb'], '<br />
                        <br />';

Change it to:

Code: [Select]
// Show their personal text?
         if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
            echo '
                        <div class="memdetails">', $message['member']['blurb'], '</div>
                        <br />';


That was it. Save the changes and re-upload the file back overwriting the old one. Personally I do think that this looks very nice on topic view. But you can judge by yourself based on the screenshot attached.

Here is like it looks in action. This is for the 1.1. series


The mod version can be found here
 
 http://custom.simplemachines.org/mods/index.php?mod=1371
 
« Last Edit: September 03, 2008, 08:10:41 AM by babjusi »

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #1 on: August 02, 2008, 03:54:32 PM »
Very nice, thanks..
İnadına SMF 1.1.X

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #2 on: August 04, 2008, 09:30:05 AM »
Indexed.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Online ormuz

  • Full Member
  • ***
  • Posts: 677
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #3 on: August 25, 2008, 02:38:45 PM »
How to add this trick to custom profile mod?

babjusi

  • Guest
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #4 on: August 25, 2008, 02:43:41 PM »
How to add this trick to custom profile mod?

I am not sure that I understood you. What is is exactly that you mean or want to accomplish by doing that? Because this has nothing to do with the custom profile mod.

Online ormuz

  • Full Member
  • ***
  • Posts: 677
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #5 on: August 25, 2008, 02:58:54 PM »
How to add this trick to custom profile mod?

I am not sure that I understood you. What is is exactly that you mean or want to accomplish by doing that? Because this has nothing to do with the custom profile mod.

Costum profile mod add the ability to add costum fields to the postbit on the display.template.php

I just want to add this trick (the memdetails div) to the field that I have in my postbit

this is the code from the mod in the display template, how to add this trick to the mod?
Code: [Select]
              global $sourcedir, $messagevars;
$messagevars = $message;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldPosts();

babjusi

  • Guest
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #6 on: August 26, 2008, 05:57:07 AM »
How to add this trick to custom profile mod?

I am not sure that I understood you. What is is exactly that you mean or want to accomplish by doing that? Because this has nothing to do with the custom profile mod.

Costum profile mod add the ability to add costum fields to the postbit on the display.template.php

I just want to add this trick (the memdetails div) to the field that I have in my postbit

this is the code from the mod in the display template, how to add this trick to the mod?
Code: [Select]
              global $sourcedir, $messagevars;
$messagevars = $message;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldPosts();

I don''t think you can add this through the custom profile mod.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #7 on: August 26, 2008, 09:31:59 AM »
You could if you arranged the styling in CustomProfile.php.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Online ormuz

  • Full Member
  • ***
  • Posts: 677
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #8 on: August 26, 2008, 03:17:36 PM »
You could if you arranged the styling in CustomProfile.php.

I ask that in the mod support topic, but a smf moderator remove my doubt there...

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #9 on: August 26, 2008, 04:05:33 PM »
Try out this:

Code: [Select]
echo '<div class="memdetails">', DisplayFieldPosts(), '</div>';

Online ormuz

  • Full Member
  • ***
  • Posts: 677
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #10 on: August 26, 2008, 07:00:10 PM »
Try out this:

Code: [Select]
echo '<div class="memdetails">', DisplayFieldPosts(), '</div>';

That was my first try, and it works! But if the custom field is empty, it show the div too... Any ideas?

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #11 on: August 26, 2008, 07:03:52 PM »
Try out this:

Code: [Select]
echo '<div class="memdetails">', DisplayFieldPosts(), '</div>';

That was my first try, and it works! But if the custom field is empty, it show the div too... Any ideas?

Yes.

if( DisplayFieldPosts() = true ) { echo '<div class="memdetails">', DisplayFieldPosts(), '</div>'; }

babjusi

  • Guest
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #12 on: August 27, 2008, 08:54:58 AM »
You could if you arranged the styling in CustomProfile.php.

Maybe, I am not familiar with the mod in question.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #13 on: August 27, 2008, 10:07:24 AM »
Try out this:

Code: [Select]
echo '<div class="memdetails">', DisplayFieldPosts(), '</div>';

That was my first try, and it works! But if the custom field is empty, it show the div too... Any ideas?

No need to do anything more, the user figured it out.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

babjusi

  • Guest
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #14 on: September 01, 2008, 12:24:51 PM »

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #15 on: September 01, 2008, 12:30:56 PM »
Perhaps a better title would be better... borderdataontopicview is kinda off the tongue. :P

babjusi

  • Guest
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #16 on: September 01, 2008, 12:48:17 PM »
Perhaps a better title would be better... borderdataontopicview is kinda off the tongue. :P

It could be, but at the moment when I made it couldn''t find a better name for it :D

Online ormuz

  • Full Member
  • ***
  • Posts: 677
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #17 on: September 01, 2008, 04:35:33 PM »
The name shloud be "Vb postbit"

babjusi

  • Guest
Re: [Tip&trick] Bordered Post Data in Topic View
« Reply #18 on: September 03, 2008, 08:08:50 AM »
The name shloud be "Vb postbit"

I like that.

Offline Smoky "Rider" Blue

  • SMF Hero
  • ******
  • Posts: 1,682
  • Gender: Female
  • It's all in your head! :p
    • smoky.blue.01 on Facebook
Re: [Tip&trick] Vb postbit
« Reply #19 on: September 05, 2008, 12:19:22 AM »
you did a great job with this babjusi, thanks for sharing! :)
Currently in secondlife, contact me for any image creation via "pm" thanks!

**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Offline Heartlander

  • Jr. Member
  • **
  • Posts: 127
Re: [Tip&trick] Vb postbit
« Reply #20 on: September 07, 2008, 03:20:23 PM »
Can anyone please answer the question regarding the purpose of this mod?
Thanks.

babjusi

  • Guest
Re: [Tip&trick] Vb postbit
« Reply #21 on: September 07, 2008, 03:38:50 PM »
Can anyone please answer the question regarding the purpose of this mod?
Thanks.

I have explained it in the first post of the topic. For more info have a look at the screenshot attached under my very first post :)

Offline matasanos

  • Jr. Member
  • **
  • Posts: 267
    • Lords-Beer.net
Re: [Tip&trick] Vb postbit
« Reply #22 on: September 19, 2008, 04:29:17 AM »
please someone knows how to add a bordered way but all items in a div element..
i hope i had explained well..sorry for my bad english.

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: [Tip&trick] Vb postbit
« Reply #23 on: October 19, 2008, 01:05:59 AM »
Do you still need help with this matasanos?
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Futbolero90

  • Semi-Newbie
  • *
  • Posts: 49
  • Gender: Male
  • NECAXISTA HASTA EL CAJON!
    • PlayStation México
Re: [Tip&trick] Vb postbit
« Reply #24 on: February 08, 2009, 03:07:54 PM »
=S i´ve installed this mod, without problems, but the postbit still looking like the default post bit :S
check: http://fifaps3xtreme.co.cc/index.php?topic=2.0
i have to activate this mod in the adminpanel or something like that?
grettings from México
and sorry my bad english

Edit:
its ok now, excelent mod :D
« Last Edit: February 08, 2009, 03:10:25 PM by Futbolero90 »


Offline chrislittle09

  • Newbie
  • *
  • Posts: 7
Re: [Tip&trick] Vb postbit
« Reply #26 on: February 11, 2009, 02:00:33 AM »
thanks for your post.

Offline SilverKnight

  • Jr. Member
  • **
  • Posts: 233
Re: [Tip&trick] Vb postbit
« Reply #27 on: March 29, 2009, 07:51:38 PM »
This is now a mod.. should probably be moved.

Offline Smoky "Rider" Blue

  • SMF Hero
  • ******
  • Posts: 1,682
  • Gender: Female
  • It's all in your head! :p
    • smoky.blue.01 on Facebook
Re: [Tip&trick] Vb postbit
« Reply #28 on: March 29, 2009, 09:32:05 PM »
it's now my mod Silverknight  ;)
Currently in secondlife, contact me for any image creation via "pm" thanks!

**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Offline JBlaze

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,152
    • @fragicide on Twitter
Re: [Tip&trick] Vb postbit
« Reply #29 on: April 24, 2009, 08:05:32 PM »
it's now my mod Silverknight  ;)

Nice job Smoky :)

Offline Smoky "Rider" Blue

  • SMF Hero
  • ******
  • Posts: 1,682
  • Gender: Female
  • It's all in your head! :p
    • smoky.blue.01 on Facebook
Re: [Tip&trick] Vb postbit
« Reply #30 on: April 24, 2009, 08:14:01 PM »
thanks Jblaze.. i took over it for Babjusi..  ;)
Currently in secondlife, contact me for any image creation via "pm" thanks!

**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Offline JBlaze

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,152
    • @fragicide on Twitter
Re: [Tip&trick] Vb postbit
« Reply #31 on: April 24, 2009, 09:27:34 PM »
thanks Jblaze.. i took over it for Babjusi..  ;)

Stealing is not nice.... :P

Offline Smoky "Rider" Blue

  • SMF Hero
  • ******
  • Posts: 1,682
  • Gender: Female
  • It's all in your head! :p
    • smoky.blue.01 on Facebook
Re: [Tip&trick] Vb postbit
« Reply #32 on: April 24, 2009, 10:27:16 PM »
lmao i didnt steal it, Babjusi gave me all his mods.. he wanted me to have them JBlaze..  8)
Currently in secondlife, contact me for any image creation via "pm" thanks!

**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Offline JBlaze

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,152
    • @fragicide on Twitter
Re: [Tip&trick] Vb postbit
« Reply #33 on: April 24, 2009, 10:55:46 PM »
lmao i didnt steal it, Babjusi gave me all his mods.. he wanted me to have them JBlaze..  8)

mhm....

lol

Offline Smoky "Rider" Blue

  • SMF Hero
  • ******
  • Posts: 1,682
  • Gender: Female
  • It's all in your head! :p
    • smoky.blue.01 on Facebook
Re: [Tip&trick] Vb postbit
« Reply #34 on: April 24, 2009, 11:28:19 PM »


                                         :P
Currently in secondlife, contact me for any image creation via "pm" thanks!

**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Offline _F3R_

  • Jr. Member
  • **
  • Posts: 169
  • Gender: Male
  • Foro Lines Admin
    • android
Re: [Tip&trick] Vb postbit
« Reply #35 on: September 22, 2009, 02:37:47 PM »
Hello guys, I install the custom profile field mod and the  Vb postbit.
in the posts the custom profile field mod doesn't work when vbpostbit.
This is display.template.php

Code: [Select]
global $sourcedir, $messagevars;
$messagevars = $message;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldPosts();

// Show how many posts they have made.
echo '
<div class="windowbg4">', $txt[26], ': ', $message['member']['posts'], '</div>';

the class of vbpostbit is <div class="windowbg4">

and this is custom profile.php
Code: [Select]
<?php

if (!defined('SMF'))
die('Hacking attempt...');

function 
EditFields()
{
global $context$modSettings;
$i 1;
while (isset($modSettings['enable_CP' $i '']))
{
if ($modSettings['enable_CP' $i ''])
{
if ($modSettings['CP' $i '_edit'] && !$context['user']['is_admin'])
{
$i++;
continue;
}
if ($modSettings['CP' $i '_hr'] == 'edit' || $modSettings['CP' $i '_hr'] == 'summary_edit')
{
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>'
;
}
if ($modSettings['CP' $i '_type']=='text')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td><td><input type="text" name="default_options[' $modSettings['CP' $i '_id'] . ']" size="50" value="', @$context['member']['options'][$modSettings['CP' $i '_id']], '" /></td>
</tr>'
;
}
if ($modSettings['CP' $i '_type']=='textarea')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td><td><textarea name="default_options[' $modSettings['CP' $i '_id'] . ']" rows="4" cols="80" class="editor">', @$context['member']['options'][$modSettings['CP' $i '_id']], '</textarea></td>
</tr>'
;
}
if ($modSettings['CP' $i '_type']=='select')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td>
<td><select name="default_options[' 
$modSettings['CP' $i '_id'] . ']">';
$r 1;
while (isset($modSettings['CP' $i '_data' $r '']) && !empty($modSettings['CP' $i '_data' $r '']))
{
if (isset($context['member']['options'][$modSettings['CP' $i '_id']]) && $context['member']['options'][$modSettings['CP' $i '_id']] == $modSettings['CP' $i '_data' $r ''])
{
echo '
<option selected="selected">' 
$modSettings['CP' $i '_data' $r ''] . '</option>';
}
else
{
echo '
<option>' 
$modSettings['CP' $i '_data' $r ''] . '</option>';
}
$r++;
}
echo '
</select></td>'
;
}
if ($modSettings['CP' $i '_type']=='check')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td><td><input type="hidden" name="default_options[' $modSettings['CP' $i '_id'] . ']" value="0" /><input type="checkbox" name="default_options[' $modSettings['CP' $i '_id'] . ']" value="1"', @$context['member']['options'][$modSettings['CP' $i '_id']] ? ' checked="checked"' ''' class="check" /></td>
</tr>'
;
}
}
$i++;
}
}

function 
RegistrationFields()
{
global $context$modSettings;
$i 1;
while (isset($modSettings['enable_CP' $i '']))
{
if ($modSettings['enable_CP' $i ''] && $modSettings['CP' $i '_reg'])
{
if ($modSettings['CP' $i '_type']=='text')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td><td><input type="text" name="default_options[' $modSettings['CP' $i '_id'] . ']" size="50" value="', @$context['member']['options'][$modSettings['CP' $i '_id']], '" /></td>
</tr>'
;
}
if ($modSettings['CP' $i '_type']=='textarea')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td><td><textarea name="default_options[' $modSettings['CP' $i '_id'] . ']" rows="4" cols="80" class="editor">', @$context['member']['options'][$modSettings['CP' $i '_id']], '</textarea></td>
</tr>'
;
}
if ($modSettings['CP' $i '_type']=='select')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td>
<td><select name="default_options[' 
$modSettings['CP' $i '_id'] . ']">';
$r 1;
while (isset($modSettings['CP' $i '_data' $r '']) && !empty($modSettings['CP' $i '_data' $r '']))
{
if (isset($context['member']['options'][$modSettings['CP' $i '_id']]) && $context['member']['options'][$modSettings['CP' $i '_id']] == $modSettings['CP' $i '_data' $r ''])
{
echo '
<option selected="selected">' 
$modSettings['CP' $i '_data' $r ''] . '</option>';
}
else
{
echo '
<option>' 
$modSettings['CP' $i '_data' $r ''] . '</option>';
}
$r++;
}
echo '
</select></td>'
;
}
if ($modSettings['CP' $i '_type']=='check')
{
echo '
<tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b>' , !empty($modSettings['CP' $i '_desc']) ? '<div class="smalltext">' $modSettings['CP' $i '_desc'] . '</div>' '' '</td><td><input type="hidden" name="default_options[' $modSettings['CP' $i '_id'] . ']" value="0" /><input type="checkbox" name="default_options[' $modSettings['CP' $i '_id'] . ']" value="1"', @$context['member']['options'][$modSettings['CP' $i '_id']] ? ' checked="checked"' ''' class="check" /></td>
</tr>'
;
}
}
$i++;
}
}

function 
CheckFieldInput()
{
global $modSettings$txt$forum_version;
$i 1;
while (isset($modSettings['enable_CP' $i '']))
{
if ($modSettings['enable_CP' $i ''] && $modSettings['CP' $i '_reg']=='force' && empty($_POST['default_options'][$modSettings['CP' $i '_id']]))
{
loadLanguage('CustomProfile');
$txt['cp_regerror'] = preg_replace('/FIELDNAME/'$modSettings['CP' $i '_name'], $txt['cp_regerror']);
fatal_lang_error('cp_regerror'false);
}
$i++;
}

// The strings aren't cleaned properly on registration.
if (version_compare($forum_version'1.1.5') != 1)
{
if (isset($_POST['default_options']))
$_POST['default_options'] = htmlspecialchars__recursive($_POST['default_options']);
if (isset($_POST['options']))
$_POST['options'] = htmlspecialchars__recursive($_POST['options']);
}
}

function 
DisplayFieldPosts()
{
global $context$modSettings$messagevars;
$i 1;
while (isset($modSettings['enable_CP' $i '']))
{
if ($modSettings['enable_CP' $i ''] && isset($messagevars['member']['options'][$modSettings['CP' $i '_id']]) && !empty($messagevars['member']['options'][$modSettings['CP' $i '_id']]) && $modSettings['CP' $i '_post'])
{
if ($modSettings['CP' $i '_view'] && !$context['user']['is_admin'])
{
$i++;
continue;
}
if ($modSettings['CP' $i '_type']=='text' || $modSettings['CP' $i '_type']=='textarea')
{
if ($modSettings['CP' $i '_post']!='text')
{
$i++;
continue;
}
$before preg_replace('/%1/'$messagevars['member']['options'][$modSettings['CP' $i '_id']], $modSettings['CP' $i '_data1']);
$after preg_replace('/%1/'$messagevars['member']['options'][$modSettings['CP' $i '_id']], $modSettings['CP' $i '_data2']);
if ($modSettings['CP' $i '_bbc'])
{
$field parse_bbc($before $messagevars['member']['options'][$modSettings['CP' $i '_id']] . $after);
}
else
{
$field $before $messagevars['member']['options'][$modSettings['CP' $i '_id']] . $after;
}
echo '
$modSettings['CP' $i '_name'] . ': ' $field '<br />';
}
if ($modSettings['CP' $i '_type']=='select')
{
if ($modSettings['CP' $i '_bbc'])
{
$field parse_bbc($messagevars['member']['options'][$modSettings['CP' $i '_id']]);
}
else
{
$field $messagevars['member']['options'][$modSettings['CP' $i '_id']];
}
echo '
$modSettings['CP' $i '_name'] . ': ' $field '<br />';
}
if ($modSettings['CP' $i '_type']=='check')
{
if ($modSettings['CP' $i '_bbc'])
{
$modSettings['CP' $i '_data1'] = parse_bbc($modSettings['CP' $i '_data1']);
$modSettings['CP' $i '_data2'] = parse_bbc($modSettings['CP' $i '_data2']);
}
if ($messagevars['member']['options'][$modSettings['CP' $i '_id']])
{
echo '
$modSettings['CP' $i '_name'] . ': ' $modSettings['CP' $i '_data1'] . '<br />';
}
else
{
echo '
$modSettings['CP' $i '_name'] . ': ' $modSettings['CP' $i '_data2'] . '<br />';
}
}
}
$i++;
}
}

function 
DisplayFieldPostsPictures()
{
global $context$modSettings$messagevars;
$i 1;
while (isset($modSettings['enable_CP' $i '']))
{
if ($modSettings['enable_CP' $i ''] && isset($messagevars['member']['options'][$modSettings['CP' $i '_id']]) && !empty($messagevars['member']['options'][$modSettings['CP' $i '_id']]) && $modSettings['CP' $i '_post'])
{
if ($modSettings['CP' $i '_view'] && !$context['user']['is_admin'])
{
$i++;
continue;
}
if ($modSettings['CP' $i '_type']=='text' || $modSettings['CP' $i '_type']=='textarea')
{
if ($modSettings['CP' $i '_post']!='image')
{
$i++;
continue;
}
$before preg_replace('/%1/'$messagevars['member']['options'][$modSettings['CP' $i '_id']], $modSettings['CP' $i '_data1']);
$after preg_replace('/%1/'$messagevars['member']['options'][$modSettings['CP' $i '_id']], $modSettings['CP' $i '_data2']);
if ($modSettings['CP' $i '_bbc'])
{
$field parse_bbc($before $messagevars['member']['options'][$modSettings['CP' $i '_id']] . $after);
}
else
{
$field $before $messagevars['member']['options'][$modSettings['CP' $i '_id']] . $after;
}
echo $field;
}
}
$i++;
}
}

function 
DisplayFieldsProfile()
{
global $context$modSettings;
$i 1;
while (isset($modSettings['enable_CP' $i '']))
{
if ($modSettings['enable_CP' $i ''] && isset($context['member']['options'][$modSettings['CP' $i '_id']]) && !empty($context['member']['options'][$modSettings['CP' $i '_id']]) && $modSettings['CP' $i '_profile'])
{
if ($modSettings['CP' $i '_view'] && !$context['user']['is_admin'])
{
$i++;
continue;
}
if ($modSettings['CP' $i '_hr'] == 'edit' || $modSettings['CP' $i '_hr'] == 'summary_edit')
{
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>'
;
}
if ($modSettings['CP' $i '_type']=='text' || $modSettings['CP' $i '_type']=='textarea')
{
$before preg_replace('/%1/'$context['member']['options'][$modSettings['CP' $i '_id']], $modSettings['CP' $i '_data1']);
$after preg_replace('/%1/'$context['member']['options'][$modSettings['CP' $i '_id']], $modSettings['CP' $i '_data2']);
if ($modSettings['CP' $i '_bbc'])
{
$context['member']['options'][$modSettings['CP' $i '_id']] = parse_bbc($before $context['member']['options'][$modSettings['CP' $i '_id']] . $after);
}
else
{
$context['member']['options'][$modSettings['CP' $i '_id']] = $before $context['member']['options'][$modSettings['CP' $i '_id']] . $after;
}
echo '
</tr><tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b></td>
<td>' 
$context['member']['options'][$modSettings['CP' $i '_id']] . '</td>';
}
if ($modSettings['CP' $i '_type']=='select')
{
if ($modSettings['CP' $i '_bbc'])
{
$field parse_bbc($context['member']['options'][$modSettings['CP' $i '_id']]);
}
else
{
$field $context['member']['options'][$modSettings['CP' $i '_id']];
}
echo '
</tr><tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b></td>
<td>' 
$field '</td>';
}
if ($modSettings['CP' $i '_type']=='check')
{
if ($modSettings['CP' $i '_bbc'])
{
$modSettings['CP' $i '_data1'] = parse_bbc($modSettings['CP' $i '_data1']);
$modSettings['CP' $i '_data2'] = parse_bbc($modSettings['CP' $i '_data2']);
}
if ($context['member']['options'][$modSettings['CP' $i '_id']])
{
echo '
</tr><tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b></td>
<td>' 
$modSettings['CP' $i '_data1'] . '</td>';
}
else
{
echo '
</tr><tr>
<td><b>' 
$modSettings['CP' $i '_name'] . ': </b></td>
<td>' 
$modSettings['CP' $i '_data2'] . '</td>';
}
}
}
$i++;
}
}

function 
CustomFieldSettings()
{
global $txt$scripturl$context$settings$sc$modSettings$txt;
loadLanguage('CustomProfile');

if (isset($_GET['cp']))
{
if ($modSettings['CP' $_GET['cp'] . '_type']=='text' || $modSettings['CP' $_GET['cp'] . '_type']=='textarea')
{
$cp $_GET['cp'];
$config_vars = array(
array('text''CP' $cp '_name'null$txt['cp_name']),
array('text''CP' $cp '_desc'null$txt['cp_desc']),
array('check''CP' $cp '_profile'null$txt['cp_profileshow']),
array('select''CP' $cp '_post', array('0' => $txt['cp_dontshow'], 'text' => $txt['cp_underpostcount'], 'image' => $txt['cp_underimages'],), $txt['cp_showposts']),
array('check''CP' $cp '_bbc'null$txt['cp_parsebbc']),
array('text''CP' $cp '_data1'null$txt['cp_before']),
array('text''CP' $cp '_data2'null$txt['cp_after']),
array('text''CP' $cp '_id'null$txt['cp_fieldid']),
array('select''CP' $cp '_hr', array('no' => $txt['cp_dontshow'], 'summary' => $txt['cp_hrsummary'], 'edit' => $txt['cp_hredit'], 'summary_edit' => $txt['cp_onboth'],), $txt['cp_hrule']),
array('select''CP' $cp '_reg', array('0' => $txt['cp_dontshow'], 'opt' => $txt['co_optinput'], 'force' => $txt['cp_forceinput'],), $txt['cp_showreg']),
array('check''CP' $cp '_edit'null$txt['cp_adminedit']),
array('check''CP' $cp '_view'null$txt['cp_adminview']),
'<a href="' $scripturl '?action=featuresettings;sa=profile;addfield=' $cp ';sesc=' $sc '">' $txt['cp_recreate'] . '</a>',
);
}
elseif ($modSettings['CP' $_GET['cp'] . '_type']=='check')
{
$cp $_GET['cp'];
$config_vars = array(
array('text''CP' $cp '_name'null$txt['cp_name']),
array('text''CP' $cp '_desc'null$txt['cp_desc']),
array('check''CP' $cp '_profile'null$txt['cp_profileshow']),
array('check''CP' $cp '_post'null$txt['cp_showposts']),
array('text''CP' $cp '_data1'null$txt['cp_checked']),
array('text''CP' $cp '_data2'null$txt['cp_notchecked']),
array('check''CP' $cp '_bbc'null$txt['cp_parsebbc']),
array('text''CP' $cp '_id'null$txt['cp_fieldid']),
array('select''CP' $cp '_hr', array('no' => $txt['cp_dontshow'], 'summary' => $txt['cp_hrsummary'], 'edit' => $txt['cp_hredit'], 'summary_edit' => $txt['cp_onboth'],), $txt['cp_hrule']),
array('select''CP' $cp '_reg', array('0' => $txt['cp_dontshow'], 'opt' => $txt['cp_show'],), $txt['cp_showreg']),
array('check''CP' $cp '_edit'null$txt['cp_adminedit']),
array('check''CP' $cp '_view'null$txt['cp_adminview']),
'<a href="' $scripturl '?action=featuresettings;sa=profile;addfield=' $cp ';sesc=' $sc '">' $txt['cp_recreate'] . '</a>',
);
}
elseif ($modSettings['CP' $_GET['cp'] . '_type']=='select')
{
$cp $_GET['cp'];
$config_vars = array(
array('text''CP' $cp '_name'null$txt['cp_name']),
array('text''CP' $cp '_desc'null$txt['cp_desc']),
array('check''CP' $cp '_profile'null$txt['cp_profileshow']),
array('check''CP' $cp '_post'null$txt['cp_showposts']),
array('check''CP' $cp '_bbc'null$txt['cp_parsebbc']),
array('text''CP' $cp '_id'null$txt['cp_fieldid']),
array('select''CP' $cp '_hr', array('no' => $txt['cp_dontshow'], 'summary' => $txt['cp_hrsummary'], 'edit' => $txt['cp_hredit'], 'summary_edit' => $txt['cp_onboth'],), $txt['cp_hrule']),
array('select''CP' $cp '_reg', array('0' => $txt['cp_dontshow'], 'opt' => $txt['cp_show'],), $txt['cp_showreg']),
array('check''CP' $cp '_edit'null$txt['cp_adminedit']),
array('check''CP' $cp '_view'null$txt['cp_adminview']),
);
$i 1;
while (isset($modSettings['CP' $cp '_data' $i '']))
{
$cp_option preg_replace('/OPTIONNUMBER/'$i$txt['cp_option']);
$config_vars[] = array('text''CP' $cp '_data'$i ''null$cp_option);
$i++;
}
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;adddata=' $cp ';sesc=' $sc '">' $txt['cp_addoption'] . '</a>';
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;addfield=' $cp ';sesc' $sc '">' $txt['cp_recreate'] . '</a>';
}
}
elseif (isset($_GET['addfield']))
{
checkSession('get');

$settings = array(
'enable_CP' $_GET['addfield'] . '' => '1',
'CP' $_GET['addfield'] . '_name' => $txt['cp_unnamed'],
'CP' $_GET['addfield'] . '_desc' => '',
'CP' $_GET['addfield'] . '_type' => 'text',
'CP' $_GET['addfield'] . '_post' => '0',
'CP' $_GET['addfield'] . '_profile' => '1',
'CP' $_GET['addfield'] . '_bbc' => '0',
'CP' $_GET['addfield'] . '_data1' => '',
'CP' $_GET['addfield'] . '_data2' => '',
'CP' $_GET['addfield'] . '_id' => 'CP' $_GET['addfield'] . '',
'CP' $_GET['addfield'] . '_hr' => '0',
'CP' $_GET['addfield'] . '_reg' => '0',
'CP' $_GET['addfield'] . '_edit' => '0',
'CP' $_GET['addfield'] . '_view' => '0',
);
addSettings($settings);
redirectexit('action=featuresettings;sa=profile');
}
elseif (isset($_GET['adddata']))
{
checkSession('get');

$i 1;
while (isset($modSettings['CP' $_GET['adddata'] . '_data' $i]))
$i++;
$settings = array(
'CP' $_GET['adddata'] . '_data' $i => '',
);
addSettings($settings);
redirectexit('action=featuresettings;sa=profile;cp=' $_GET['adddata']);
}
elseif (isset($_GET['moveup']))
{
checkSession('get');

moveUp($_GET['moveup']);
redirectexit('action=featuresettings;sa=profile');
}
elseif (isset($_GET['movedown']))
{
checkSession('get');

moveDown($_GET['movedown']);
redirectexit('action=featuresettings;sa=profile');
}
elseif (isset($_GET['delete']))
{
checkSession('get');

deleteField($_GET['delete']);
redirectexit('action=featuresettings;sa=profile');
}
else
{
$config_vars = array();
$i 1;
while (isset($modSettings['enable_CP' $i]))
{
$n $i 1;
if ($n 1)
{
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;cp=' $n '">' $txt['cp_settings'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;moveup=' $n ';sesc=' $sc '">' $txt['cp_moveup'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;movedown=' $n ';sesc=' $sc '">' $txt['cp_movedown'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;delete=' $n ';sesc=' $sc '">' $txt['cp_delete'] . '</a>';
$config_vars[] = '';
}
elseif ($n 0)
{
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;cp=' $n '">' $txt['cp_settings'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;movedown=' $n ';sesc=' $sc '">' $txt['cp_movedown'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;delete=' $n ';sesc=' $sc '">' $txt['cp_delete'] . '</a>';
$config_vars[] = '';
}
$cp_enable preg_replace('/FIELDNAME/'$modSettings['CP' $i '_name'], $txt['cp_enable']);
$config_vars[] = array('check''enable_CP' $i ''null$cp_enable);
$config_vars[] = array('select''CP' $i '_type', array('text' => $txt['cp_text'], 'textarea' => $txt['cp_textarea'], 'check' => $txt['cp_checkbox'], 'select' => $txt['cp_selectbox'],), $txt['cp_type']);
$i++;
}
$n $i 1;
if ($n 1)
{
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;cp=' $n '">' $txt['cp_settings'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;moveup=' $n ';sesc=' $sc '">' $txt['cp_moveup'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;delete=' $n ';sesc=' $sc '">' $txt['cp_delete'] . '</a>';
$config_vars[] = '';
}
elseif ($n == 1)
{
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;cp=' $n '">' $txt['cp_settings'] . '</a> <a href="' $scripturl '?action=featuresettings;sa=profile;delete=' $n ';sesc=' $sc '">' $txt['cp_delete'] . '</a>';
$config_vars[] = '';
}
$txt['cp_addfield'] = preg_replace('/FIELDNUMBER/'$i$txt['cp_addfield']);
$config_vars[] = '<a href="' $scripturl '?action=featuresettings;sa=profile;addfield=' $i ';sesc=' $sc '">' $txt['cp_addfield'] . '</a>';
}

if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=profile');
}

if (isset($_GET['cp']))
{
$txt['cp_fieldsettings'] = preg_replace('/FIELDNUMBER/'$_GET['cp'], $txt['cp_fieldsettings']);
$context['settings_title'] = $txt['cp_fieldsettings'];
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=profile;cp=' $_GET['cp'] .'';
}
else
{
$context['settings_title'] = $txt['cp_cpfields'];
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=profile';
}

prepareDBSettingContext($config_vars);
}

function 
addSettings($settings$overwrite false)
{
global $db_prefix;

$string '';
foreach ($settings as $k => $v)
$string .= '
(\'' 
$k '\', \'' addslashes($v) . '\'),';

if ($string != '')
$result db_query("
. ($overwrite 'REPLACE' 'INSERT IGNORE') . " INTO {$db_prefix}settings
(variable, value)
VALUES" 
substr($string0, -1),__FILE__,__LINE__);
}

function 
moveDown($id)
{
global $modSettings;

$replace $id 1;
if (!isset($modSettings['enable_CP' $id '']) || !isset($modSettings['enable_CP' $replace '']))
return false;

$settings = array(
'enable_CP' $replace '' => $modSettings['enable_CP' $id],
'CP' $replace '_name' => $modSettings['CP' $id '_name'],
'CP' $replace '_desc' => $modSettings['CP' $id '_desc'],
'CP' $replace '_type' => $modSettings['CP' $id '_type'],
'CP' $replace '_post' => $modSettings['CP' $id '_post'],
'CP' $replace '_profile' => $modSettings['CP' $id '_profile'],
'CP' $replace '_bbc' => $modSettings['CP' $id '_bbc'],
'CP' $replace '_id' => $modSettings['CP' $id '_id'],
'CP' $replace '_hr' => $modSettings['CP' $id '_hr'],
'CP' $replace '_reg' => $modSettings['CP' $id '_reg'],
'CP' $replace '_edit' => $modSettings['CP' $id '_edit'],
'CP' $replace '_view' => $modSettings['CP' $id '_view'],
'enable_CP' $id '' => $modSettings['enable_CP' $replace],
'CP' $id '_name' => $modSettings['CP' $replace '_name'],
'CP' $id '_desc' => $modSettings['CP' $replace '_desc'],
'CP' $id '_type' => $modSettings['CP' $replace '_type'],
'CP' $id '_post' => $modSettings['CP' $replace '_post'],
'CP' $id '_profile' => $modSettings['CP' $replace '_profile'],
'CP' $id '_bbc' => $modSettings['CP' $replace '_bbc'],
'CP' $id '_id' => $modSettings['CP' $replace '_id'],
'CP' $id '_hr' => $modSettings['CP' $replace '_hr'],
'CP' $id '_reg' => $modSettings['CP' $replace '_reg'],
'CP' $id '_edit' => $modSettings['CP' $replace '_edit'],
'CP' $id '_view' => $modSettings['CP' $replace '_view'],
);

$i 1;
while (isset($modSettings['CP' $id '_data' $i]))
{
$settings['CP' $replace '_data' $i] = $modSettings['CP' $id '_data' $i];
$i++;
}
$i 1;
while (isset($modSettings['CP' $replace '_data' $i]))
{
$settings['CP' $id '_data' $i] = $modSettings['CP' $replace '_data' $i];
$i++;
}

addSettings($settingstrue);
}

function 
moveUp($id)
{
global $modSettings;

$replace $id 1;
if (!isset($modSettings['enable_CP' $id '']) || !isset($modSettings['enable_CP' $replace '']))
return false;

$settings = array(
'enable_CP' $replace '' => $modSettings['enable_CP' $id],
'CP' $replace '_name' => $modSettings['CP' $id '_name'],
'CP' $replace '_desc' => $modSettings['CP' $id '_desc'],
'CP' $replace '_type' => $modSettings['CP' $id '_type'],
'CP' $replace '_post' => $modSettings['CP' $id '_post'],
'CP' $replace '_profile' => $modSettings['CP' $id '_profile'],
'CP' $replace '_bbc' => $modSettings['CP' $id '_bbc'],
'CP' $replace '_id' => $modSettings['CP' $id '_id'],
'CP' $replace '_hr' => $modSettings['CP' $id '_hr'],
'CP' $replace '_reg' => $modSettings['CP' $id '_reg'],
'CP' $replace '_edit' => $modSettings['CP' $id '_edit'],
'CP' $replace '_view' => $modSettings['CP' $id '_view'],
'enable_CP' $id '' => $modSettings['enable_CP' $replace],
'CP' $id '_name' => $modSettings['CP' $replace '_name'],
'CP' $id '_desc' => $modSettings['CP' $replace '_desc'],
'CP' $id '_type' => $modSettings['CP' $replace '_type'],
'CP' $id '_post' => $modSettings['CP' $replace '_post'],
'CP' $id '_profile' => $modSettings['CP' $replace '_profile'],
'CP' $id '_bbc' => $modSettings['CP' $replace '_bbc'],
'CP' $id '_id' => $modSettings['CP' $replace '_id'],
'CP' $id '_hr' => $modSettings['CP' $replace '_hr'],
'CP' $id '_reg' => $modSettings['CP' $replace '_reg'],
'CP' $id '_edit' => $modSettings['CP' $replace '_edit'],
'CP' $id '_view' => $modSettings['CP' $replace '_view'],
);

$i 1;
while (isset($modSettings['CP' $id '_data' $i]))
{
$settings['CP' $replace '_data' $i] = $modSettings['CP' $id '_data' $i];
$i++;
}
$i 1;
while (isset($modSettings['CP' $replace '_data' $i]))
{
$settings['CP' $id '_data' $i] = $modSettings['CP' $replace '_data' $i];
$i++;
}

addSettings($settingstrue);
}

function 
deleteField($id)
{
global $modSettings;

if (!isset($modSettings['enable_CP' $id '']))
return false;

$i $id 1;
while (isset($modSettings['enable_CP' $i '']))
{
moveUp($i);
echo 'up';
$i++;
}
$i--;
$settings = array('enable_CP' $i'CP' $i '_name''CP' $i '_desc''CP' $i '_type''CP' $i '_post''CP' $i '_profile''CP' $i '_bbc''CP' $i '_id''CP' $i '_hr''CP' $i '_reg''CP' $i '_edit''CP' $i '_view',);
$n 1;
while (isset($modSettings['CP' $i '_data' $n]))
{
$settings[] = 'CP' $i '_data' $n;
$n++;
}

deleteSettings($settings);

}

function 
deleteSettings($settings)
{
global $db_prefix;

foreach ($settings as $delete)
$result db_query("DELETE FROM {$db_prefix}settings WHERE variable = '$delete' LIMIT 1"__FILE____LINE__);
}
?>

Sorry with my english, because i don't speack english
Tu Android Una nueva comunidad
http://forolines.com A new comunit

Offline Realinfo

  • Full Member
  • ***
  • Posts: 626
    • Real Info
Re: [Tip&trick] Vb postbit
« Reply #36 on: January 08, 2012, 02:41:31 AM »
Can it possible in 2.0.2.............. Now I have 2.0.2.............. In 1.1.16, I could do it, but not in 2.0.2

Offline mr.Curiosity

  • Jr. Member
  • **
  • Posts: 108
  • Gender: Male
    • tarry.bychoo on Facebook
Re: [Tip&trick] Vb postbit
« Reply #37 on: April 09, 2012, 03:09:00 AM »
Like This...


Thank You.

Zelite poptpuno besplatno reklamirati svoj server?
Posjetite  www.reklamiraj-server.netne.net
Ocekujemo Vas!