(Help) Hide custom ...
 
Notifications
Clear all

(Help) Hide custom profile link

7 Posts
2 Users
0 Reactions
2,582 Views
(@lazuli)
Posts: 61
Trusted Member
Topic starter
 

You're going to be sick and tired of me by the time I learn 3.0.  😛

I'm working on a custom beta reader profile for 3.0.

I already have a version for 2.0 active on my main site.

So far, it's coming together pretty good, but I have one problem that doesn't seem to want to be solved.

I would like to include a link on my user profiles, but only if they're a beta reader.  I tried using the codeblocks, but it didn't work for me.  How would I go about adding this?

Thanks!


I'm sorry, but due to my schedule, I am not available for commissions.

Blog | DA Account

 
Posted : 28/02/2007 5:46 pm
(@tammy)
Posts: 2577
Member Moderator
 

You're going to have to be more specific than that.  What did you try with the codeblocks?  Are you using the standard betareader profile  field or are you creating a custom field of your own?


 
Posted : 28/02/2007 6:27 pm
(@lazuli)
Posts: 61
Trusted Member
Topic starter
 

I'm sorry, Tammy.

This is an entirely custom module.  I created a table called fanfiction_beta that contains all information regarding beta readers.  It contains the user's uid, status, categories, a couple text fields, a keywords field, and then some other settings that control a bulleted list of the things they're willing to check for.

Status is the field I'm using to determine whether the profile appears or not.  It has three settings:

0 = Default; Off / Not a beta reader
1 = Beta Reader
2 = On Hiatus

The display panel works, and I'm still working on the otherresults and the form.  All that's left to create is the listing and the link in the profiles.  The other results link is up, but since I don't have the listing page done, it doesn't point to the right place yet.

I thought authorof.php in challenges was being called in the profile for the links, but now I'm getting the feeling I was wrong.  Anyway, I created a file called /modules/betas/authorof.php and added it to the codeblocks table.

fanfiction_codeblocks:
code_id: 9
code_text: include(_BASEDIR."modules/betas/authorof.php");
code_type: AO
code_module: betas

I then put this in it:

if(!defined("_CHARSET")) exit( );

if(file_exists(_BASEDIR."modules/betas/languages/{$language}.php"))
include_once(_BASEDIR."modules/betas/languages/{$language}.php");
else include_once(_BASEDIR."modules/betas/languages/en.php");

$betaquery = dbquery("SELECT status FROM ".$tableprefix."fanfiction_beta WHERE uid = $uid");
list($betastatus) = dbrow($betaquery);

if($betastatus >= "1") {
$tpl->assign("betaprofile", "<a href="'".$thislink."action=beta'>"._BETAREADER."</a>";"
}
else {
$tpl->assign("betaprofile","");
}

(If anyone goes exploring, stay out of my challenges for now.  Marohi isn't done there and some pages spit out miles of errors.)


I'm sorry, but due to my schedule, I am not available for commissions.

Blog | DA Account

 
Posted : 28/02/2007 9:03 pm
(@tammy)
Posts: 2577
Member Moderator
 

The AO code_type builds the "Author of" list in the user's Statistics page.  For example:

http://sgxover.hugosnebula.com/viewuser.php?action=stats&uid=1

You want to create the "tab" link to the user's page? (ie "Author Profile", "Contact", etc.)  Or are you wanting to add the link in the profile area up with "Gender", "Bio", etc.

If you want the "tab" all you need to do is add the Beta Profile to the panels as a profile panel. 

If you want the link you seem to have it except you need to make it a custom profile field.  I think you should be good if you give it name, title, enable it, use custom code as the type, leave the form code blank, and enter your code in the profile code section.


 
Posted : 28/02/2007 11:48 pm
(@lazuli)
Posts: 61
Trusted Member
Topic starter
 

OH, okay.  I didn't realize that was for the statistics page.

I wanted to create a tab, but hide it if they weren't a beta reader.  But since all I'm doing is creating a link, I could probably get away with it as a custom profile field.

Thanks so much!  I hope I'm not getting too annoying here.


I'm sorry, but due to my schedule, I am not available for commissions.

Blog | DA Account

 
Posted : 01/03/2007 1:01 am
(@tammy)
Posts: 2577
Member Moderator
 

I haven't gotten around to updating the "tabs" section so you can add codeblocks to it so you can do what you want.  It's on the "To Do" list for a future release.


 
Posted : 01/03/2007 1:11 am
(@lazuli)
Posts: 61
Trusted Member
Topic starter
 

That would definitely be useful.  Hopefully by then I can help more.  I feel guilty that I wasn't able to really help at all for 3.0


I'm sorry, but due to my schedule, I am not available for commissions.

Blog | DA Account

 
Posted : 01/03/2007 1:33 am
Share: