Custom Profile Field value as BBcode

Mod Support

Moderators: BNa, Sekuro, 4seven

Custom Profile Field value as BBcode

Postby Mess » 01 Feb 2013, 14:12

4seven, a few years ago you made a snippet for posting CPFs as bbcode. And posted it on phpbb.com. I stubled across it while searching on google.
I need it to insert the posters CPF instead of the readers. Is that something you can fix, and is willing to? :)

Here is the post: https://www.phpbb.com/community/viewtop ... &t=2122964

4_seven wrote:Example: Here you can see, what a viewer set in his CPF "Car"
http://4seven.kilu.de/phpbb3/viewtopic. ... 1845#p1845
- un: utest / pw: testtest
- change the CPF "Car" in UCP.
Guests see: "You have no car"

---------------------

make a bbcode

bbcode
Code: Select all
[customer_id][/customer_id]


replacement
Code: Select all
<a href="http://www.xyz.com/support?{L_CUSTOMER_ID}">www.xyz.com/support?{L_CUSTOMER_ID}</a>


open

language/en/viewtopic.php

find

Code: Select all
$lang = array_merge($lang, array(


replace with

Code: Select all
// Display CPF Value of Topic-Viewer via BBCode / 4seven / 2011
global $db, $user;
$sql = 'SELECT pf_customer_id
        FROM '
 . PROFILE_FIELDS_DATA_TABLE . '
        WHERE user_id = '
 . (int) $user->data['user_id'];
        $result = $db->sql_query($sql, 3600);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);   
     
$customer_id 
= (isset($row['pf_customer_id'])) ? $row['pf_customer_id'] : false;        
// Display CPF Value of Topic-Viewer via BBCode / 4seven / 2011

$lang = array_merge($lang, array(

     // Display CPF Value of Topic-Viewer via BBCode / 4seven / 2011
     'CUSTOMER_ID'        => ($customer_id) ? $customer_id : 0,
     // Display CPF Value of Topic-Viewer via BBCode / 4seven / 2011                   


change all instances of pf_customer_id to your tablefield name

-------------------------------------

note:
- if you want to have a preview in posting-box, make the same change to language/en/posting.php
- if you have more languages, make this change to all relevant language files
Mess

Tiptop

Tiptop
 
Posts: 13
Joined: 12 Jul 2012, 18:46
 
Resolution: 1920x1080


Re: Custom Profile Field value as BBcode

Postby 4seven » 03 Feb 2013, 01:43

    May a prototype

  • Go to your profile, fill out the CPF "Test".
  • Make a testpost here: viewtopic.php?f=14&t=265
    (Use the BBCode button >> [custom]).
  • Use the normal [Preview] Button, not the new jQ Preview Engine*
    *because jQ Preview needs a customizing for that
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4seven

Tiptop

Tiptop
 
Posts: 318
Joined: 20 Jun 2012, 16:55
 
Resolution: 1920x1080



Re: Custom Profile Field value as BBcode

Postby 4seven » 04 Feb 2013, 20:12

The CPF "Test" you find here

cpf_test.png
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4seven

Tiptop

Tiptop
 
Posts: 318
Joined: 20 Jun 2012, 16:55
 
Resolution: 1920x1080


Re: Custom Profile Field value as BBcode

Postby Mess » 06 Feb 2013, 00:45

CPF not visible to me. :(
Mess

Tiptop

Tiptop
 
Posts: 13
Joined: 12 Jul 2012, 18:46
 
Resolution: 1920x1080


Re: Custom Profile Field value as BBcode

Postby 4seven » 06 Feb 2013, 02:07

I dont noticed that, because as mod/admin i saw all fields

Code: Select all
ACP > CPF > Visibility options >
Display in user control panel
The user is able to change this profile field within the user control panel [x]

Now you should see it.
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4seven

Tiptop

Tiptop
 
Posts: 318
Joined: 20 Jun 2012, 16:55
 
Resolution: 1920x1080


Re: Custom Profile Field value as BBcode

Postby Mess » 06 Feb 2013, 14:53

Works! :D
Mess

Tiptop

Tiptop
 
Posts: 13
Joined: 12 Jul 2012, 18:46
 
Resolution: 1920x1080

Re: Custom Profile Field value as BBcode

Postby Mess » 25 Feb 2013, 12:33

Crossing my fingers this will get released. :)
Mess

Tiptop

Tiptop
 
Posts: 13
Joined: 12 Jul 2012, 18:46
 
Resolution: 1920x1080


Re: Custom Profile Field value as BBcode

Postby 4seven » 25 Feb 2013, 15:05

You ask, if this is possible and not, if i can build a mod for you. So its currently a proof of concept.
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4seven

Tiptop

Tiptop
 
Posts: 318
Joined: 20 Jun 2012, 16:55
 
Resolution: 1920x1080



Return to Support Forum

Who is online

Users browsing this forum: No registered users and 2 guests

cron