• Welcome to Simple Machines Community Forum. Please login or sign up.

Custom Profile Field Mod

Started by winrules, March 30, 2006, 02:21:25 PM

Previous topic - Next topic

Arantor

No, that file is damaged now, the idea isn't to just copy/paste the contents, you will need to use FTP to download the file itself (because the file I give you will have to be uploaded back)
No good deed goes unpunished
All helpful urges should be circumvented

Sefket

Hm, here.

I don't use FTP nor do my friends. I got it from the ACP.

Arantor

Yes, and it's STILL damaged, and if I give you the edits, it'll be damaged again.

The contents of the file:
Beginning on line 1:

<?php
// Version: 1.1; Display


Beginning on line 3:

function 
template_main()
{
   global 
$context$settings$options$txt$scripturl$modSettings;

   
// Show the anchor for the top and for the first message. If the first message is new, say so.
   
echo '
<a name="top"></a>


This is NOT how it should be since I can't even test it properly to check it'll work for you even if I do make the edits, since I won't be giving you a file you can put back into the ACP!!
No good deed goes unpunished
All helpful urges should be circumvented

Sefket

Oh, the content part is all hidden and it only shows in the PHP File in FTP? I'll have to get FTP access and I'll post it here.

Is there any other possible way I can do this without FTP though? Since none of my Administrators use it.

Arantor

Not really, no, because the inbuilt editor is designed for smaller editor parts.

And really, if you're going to run a site, learning to use a basic tool like FTP, that's been around for nearly 25 years is really something of a requirement - you can even get plugins for browsers to make it easier to use, or heck even cPanel would be preferable at this stage.
No good deed goes unpunished
All helpful urges should be circumvented

Kyu~

Hi Hi, I install this mod on my forum, version 1.1.11, and I have one problem, when I put settings for Text and Text Area, shows all the options, but when I put settings for Check Box and Selection Box, shows the options for Text and Text Area. I need the options for Selection Box for add option 1, option 2, etc...

When I put settings for Selection Box, appears this options:
Name     
Field Description    
Show in profile?    
Show in posts?    
Parse BBC?    
Text to display before field (BBC is ok if enabled above)    
Text to display after field (BBC is ok if enabled above)    
Field ID    
Add a horizontal rule before field?    
Show field on registration?    
Only allow admins to edit field?    
Only allow admins to view field?


Nothing more, please help me ^^!

The other mods that I have installed are:
Spoiler BBCode
Hide Tag Special
YouTube BBCode
FontandSizeDropdown_1.3
SimplePortal

That, thanks ^^!

PS: Sorry for my english, i speak spanish xD! And by the way, my forum is in spanish too..

ispasov

Quote from: Arantor on May 03, 2010, 07:44:09 AM
ispasov: As the mod page says: look in Features and Options

zamg0d1: I can't read your mind to determine what errors you're getting, care to post them?

Well, This is what I've done:
I extracted the mode locally and upload it to the Packages directory. Applied the mode from package manager. After that I couldn't find any options of that mode anywhere in administration part of the forum.
Also I got errors in Error log:

Undefined index: cp_cpfields
File: ......../Sources/ModSettings.php
Line: 142

and

my-forum/index.php?action=featuresettings;sa=layout;sesc
Language file 'CustomProfile.bulgarian-utf8' can't be loaded

My admin part is in Bulgarian, so I made the translation of the upper errors.

My questions are: How to manage these errors and how to make this mode work.

Thanks :)

Kindred

why did you extract it?   Leave it as an archive and upload to your site using the package manager functions.
Your error indicates that the DB update file did not get run.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ispasov

I did it your way and the errors are the same. Now what?
I am using SMF 1.1.11.

Kindred

oh...   two other things.

1- if you are using a theme other than default, you will have to manually install the mod into that (or those) theme(s).
2- if you are using a language other than English, you will have to manually add the language strings into modifications.YOURLANGUAGE.php
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ispasov


Sefket

I downloaded it on the CPanel.


Sefket


Yağız...

Try attached file. But with that, it will show every custom profile field in one table.

Sefket

Eh, I don't want it all in one line. I want one to say IRC: then <br>RSN:


Yağız...

Find this in ./Sources/CustomProfile.php:
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++;
}
}

Replace with:
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 '
<div class="windowbg4">' . $modSettings['CP' . $i . '_name'] . ': ' . $field . '</div>';
}
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 '
<div class="windowbg4">' . $modSettings['CP' . $i . '_name'] . ': ' . $field . '</div>';
}
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 '
<div class="windowbg4">' . $modSettings['CP' . $i . '_name'] . ': ' . $modSettings['CP' . $i . '_data1'] . '</div>';
}
else
{
echo '
<div class="windowbg4">' . $modSettings['CP' . $i . '_name'] . ': ' . $modSettings['CP' . $i . '_data2'] . '</div>';
}
}
}
$i++;
}
}

Sefket


LBizGrl

Can this be used with Tiny Portal? If yes, is there already a post with instructions? I have portal and 1.1.11 and want profile fields...
Smile! :)

It burns WAY more calories than a frown!

LBizGrl

OK, found my issue here:

Quote from: web5 on March 17, 2010, 09:22:57 PM
Quote from: bhaveshtolia on February 28, 2010, 11:05:54 AM
Hi All,

Shttp://www.simplemachines.org/community/Smileys/default/smiley.giforry to seem naive and all but i have installed this mod and am unable to find the option where it has been enabled.

It has been installed successfully on my website. However i am unable to find the option under Features and Options.

Advise where to activate it ...

Hi there

Having the same problem as several other users. Have installed mod in version 1.1.11. (Have also manually checked each file) - all installed correctly. Using Default Theme and English Language.

Tab is not showing under 'Features and Options'. Using direct link to tab...

index.php?action=featuresettings;sa=profile

...opens the tab, but it is blank with only a SAVE button.

Sounds like a great mod - would really like to use. Does anyone have a fix?

Thanks
Tim

and this solutions....
Quote from: Kindred on March 18, 2010, 01:16:07 AM
I am betting you are not actually using English, but rather are using English UTF-8 (which is not the same thing)


hcfwesker, I was wrong... you'll have to edit DisplayFieldPosts in CustomProfile.php'

but I do not know where to change English from UT8 to correct???
Smile! :)

It burns WAY more calories than a frown!

Advertisement: