Page Index Toggle Pages: 1 ... 5 6 [7]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Add new board on Registration (Read 50615 times)
Outumuro
God Member
*****
Offline


Publisher - YaBB Toolbar

Posts: 569
Location: Los Angeles
Joined: Apr 14th, 2004
Gender: Male
Re: Add new board on Registration
Reply #90 - Jan 3rd, 2008 at 3:22am
Print Post  
Hi jasnner,

How about going with a mainstream blog, like Movable Type or WordPress... then writing a YaBB integration bridge for it?!
  


Back to top
WWW  
IP Logged
 
jasnner
New Member
*
Offline


Bonsai!

Posts: 49
Joined: May 31st, 2007
Gender: Male
Re: Add new board on Registration
Reply #91 - Jan 3rd, 2008 at 7:10am
Print Post  
I had a look at Movable Type today and was impressed with the features it provides. Might need to write a few plugins to tailor it to my needs.

Thanks for the suggestion.
  

Study english, and have fun www.english-nikki.com
Back to top
WWW  
IP Logged
 
Outumuro
God Member
*****
Offline


Publisher - YaBB Toolbar

Posts: 569
Location: Los Angeles
Joined: Apr 14th, 2004
Gender: Male
Re: Add new board on Registration
Reply #92 - Jan 3rd, 2008 at 11:04am
Print Post  
I agree... MT is impressive.

WP is great... but MT is god fearing!  Wink
  


Back to top
WWW  
IP Logged
 
jans
Senior Member
****
Offline


Oooops!

Posts: 374
Location: Meppel
Joined: Oct 27th, 2005
Gender: Male
Re: Add new board on Registration
Reply #93 - Jan 3rd, 2008 at 8:22pm
Print Post  
I am getting an error on step 6 and 7 of the mod and looked for the styring but cant find it by hand too, can you tell me where (after which string section) the modifications are to be made ? or are you willing to check out my pl file ?
  
Back to top
WWW  
IP Logged
 
jasnner
New Member
*
Offline


Bonsai!

Posts: 49
Joined: May 31st, 2007
Gender: Male
Re: Add new board on Registration
Reply #94 - Jan 4th, 2008 at 5:23am
Print Post  
step 6 is:

Code
Select All
<search for>
$yymain .= ext_editprofile($user,"options") . qq~
</search for>

<replace>
	$useBlogFieldInput = ext_gen_editfield('0', $user);
	$selfIntroFieldInput = ext_gen_editfield('1', $user);
	$yymain .= qq~
  <tr class="windowbg">
	    <td width="320" align="left"><b>$blog_txt{'2'}</b></td>
	    <td align="left">
		  $useBlogFieldInput<br/><small>$blog_txt{'3'}</small>
	  </td>
  </tr><tr class="windowbg">
	  <td width="320" align="left"><b>$blog_txt{'4'}</b></td>
	  <td align="left">
		  $selfIntroFieldInput
	  </td>
  </tr>
</replace>
 



The line "$yymain .= ext_editprofile($user,"options") . qq~" can be found in the Profile.pl file, in the "ModifyProfileOptions2" subroutine. In my Profile.pl file the following code procedes this line.

Code
Select All
sub ModifyProfileOptions {
	&SidCheck;

	&PrepareProfile;
	my $user = $INFO{'username'};
	if (!${$uid.$user}{'password'}) { &LoadUser($user); }
	$menucolors[2] = "titlebg";
	&ProfileMenu;
	&ToChars(${$uid.$user}{'usertext'});
	$yymain .= qq~
<form sid'}" method="post" name="creator" enctype="multipart/form-data">
<table cellspacing="1" cellpadding="4" width="100%" align="center" class="bordercolor" border="0">
  <tr>
    <td colspan="2" class="catbg"><img src="$imagesdir/profile.gif" alt="" border="0" /><b>$profile_txt{'79'} ($INFO{'username'}) (I;(B $profile_txt{818}</b></td>
  </tr>
    ~;
 



In regard to Step 7 - have a look at reply #85 and #86 on this thread to see a solution found by some other moders.
  

Study english, and have fun www.english-nikki.com
Back to top
WWW  
IP Logged
 
jans
Senior Member
****
Offline


Oooops!

Posts: 374
Location: Meppel
Joined: Oct 27th, 2005
Gender: Male
Re: Add new board on Registration
Reply #95 - Jan 4th, 2008 at 11:35am
Print Post  
qoute:
The line "$yymain .= ext_editprofile($user,"options") . qq~" can be found in the Profile.pl file, in the "ModifyProfileOptions2" subroutine. In my Profile.pl file the following code procedes this line.
end quote:

Do you mean precedes in stead of procedes in your answer ?

And then where do I best place the code then ?

Sorry for beeing such an dumbass Smiley
  
Back to top
WWW  
IP Logged
 
jasnner
New Member
*
Offline


Bonsai!

Posts: 49
Joined: May 31st, 2007
Gender: Male
Re: Add new board on Registration
Reply #96 - Jan 5th, 2008 at 10:35pm
Print Post  
Sorry, i meant "precede".

So look for some similar code, that starts the ModifyProfileOptions subroutine, and place the new code after it.
  

Study english, and have fun www.english-nikki.com
Back to top
WWW  
IP Logged
 
batchman
Global Moderator
*****
Offline


What's up?!

Posts: 1280
Location: Orlando
Joined: Apr 28th, 2002
Gender: Male
Re: Add new board on Registration
Reply #97 - Mar 18th, 2008 at 3:55am
Print Post  
Well, this worked very oddly for me!

When I went in and said to do a blog board for the admin, it created a blog board, but it also changed the general board to have the same description and picture as the admin blog board.

Then I clicked for a test account to have a blog board, and it did -not- create a new blog board, but it did duplicate the general board, so now I have two identical general boards. Weird.
  

Improving my forum, one mod at a time!


Now up and running again, with an accurate link.


Back to top
WWW  
IP Logged
 
ChiMoHe
Full Member
***
Offline


I love YaBB 2.2

Posts: 197
Joined: Apr 4th, 2007
Re: Add new board on Registration
Reply #98 - Mar 20th, 2008 at 5:42pm
Print Post  
Greetings,

jasnner sent me a message
Quote:
Hi ChiMoHe,

I have taken my forum off the Internet, and haven't tried updating it for YaBB2.2

I appreciate your work in keeping this mod alive, but I am busy with other projects. I suggest you start a new thread in Beta Mod for 2.2 and see if anyone else is interested in helping you.

Good luck!


so I'll get more acquainted with this mod and get back to you ASAP ... Hopefully by Saturday morning I'm have this ($INFO{'username'} fixed ...

batchman wrote on Mar 18th, 2008 at 3:55am:
When I went in and said to do a blog board for the admin, it created a blog board, but it also changed the general board to have the same description and picture as the admin blog board.


I've had this happen the first time installed but it didn't do again after that so I can't varify yet.  I'll set up a clean test board and try to repeat it to see what's going on.  I know everytime a description is changed and/or a new blog board is created there's a bunch of spaces that get added to the first few lines of forum.control  

this might have something to do with it

batchman wrote on Mar 18th, 2008 at 3:55am:
Then I clicked for a test account to have a blog board, and it did -not- create a new blog board, but it did duplicate the general board, so now I have two identical general boards. Weird.


I think this is caused by the mod using ($INFO{'username'}

when admin modifies a profile that is not admin's profile, the blog board get made using Admin instead of the username whose description is being modified.  

As far as I know these 2 are the only issues
(except <search tags> in mod file fixed in this posts attachment)

I have everything else setup for y2.2.1 ... I'm going to work on y2.1 first and when this issue is worked out I'll post y2.2.1

Please let me know any other issues

Thank you for your patience
Chi

Edited:
IF Anyone feels they can provide a fix for any issue before I can please do so ... and/or a better fix please do so ... I am a novice though I will try to keep up.  


[edit 2]updated to v3_1
change <search for> in mod description to search for to prevent description from being part of step 1

fixed step 3 and 7[/edit]
« Last Edit: Mar 21st, 2008 at 12:56am by ChiMoHe »  

BlogCategory_v3_1a.zip (Attachment deleted)

soundcloud.com/chimohe
Back to top
IP Logged
 
ChiMoHe
Full Member
***
Offline


I love YaBB 2.2

Posts: 197
Joined: Apr 4th, 2007
Re: Add new board on Registration
Reply #99 - Mar 21st, 2008 at 3:01am
Print Post  
I've tested it a few different ways and can not recreate the duplicate issue using BlogCategory_v3_1 attached to above post

Thanks

If there are no objections ...
Now I'll work move on to putting ModifyBlogData into it's own sub with view blog link in profile
« Last Edit: Mar 21st, 2008 at 4:24am by ChiMoHe »  

soundcloud.com/chimohe
Back to top
IP Logged
 
ChiMoHe
Full Member
***
Offline


I love YaBB 2.2

Posts: 197
Joined: Apr 4th, 2007
Re: Add new board on Registration
Reply #100 - Mar 24th, 2008 at 1:34am
Print Post  
I've narrowed down what we need to not double ...

in BlogCategory,pl

Code
Select All
sub checkUpdateBoard{
    my ($oldIntro, $newIntro, $oldPic, $newPic, $boardName);
    $oldIntro = $_[0];
    $newIntro = $_[1];
    $oldPic = $_[2];
    $newPic = $_[3];
    if (!($newPic =~ m!http://!)){
	$newPic = "$facesurl/$newPic";
    }
    $boardName = $_[4];
    if($oldIntro ne $newIntro || $oldPic ne $newPic){
	my(@forumControl) = &loadBoards('forum.control');
	foreach $board (@forumControl){
	    if ($board =~ m/"|$boardName|"/){
		my (@board) = split(/\|/, $board);
		#only update what changed
		if($oldIntro ne $newIntro){
		    $board[3] = $newIntro;
		}
		if($oldPic ne $newPic){
		    $board[2] = $newPic;
		}
		$board = join('|', @board);
		last;
	    } else {
		next;
	    }
	}
	#save the file
	&saveBoards(\@forumControl, 'forum.control');
    }
}
 



we need a string to check if board exsists and if exsists, not add again.

I'm not sure how to do it ...

Thankyou for your assistance

[edit]I'm pretty sure it's this line

$board = join('|', @board);

that joins the first board created "admin" for example with modified board "admin" as a new board istead of same board

[edit]I've also found that in forum.control
every time you uncheck useBlog and save and then go back in and check useBlog is adds Board

example
Code
Select All
members|admin|http://www.revolutionsplan.com/Trip2Blog/yabbfiles/avatars/kid.jpg|self intro test 1|admin, admin|||||0||||1|||
 members|admin|http://www.revolutionsplan.com/Trip2Blog/yabbfiles/avatars/kid.jpg|self intro test 2|admin, admin|||||0||||1|||
     members|admin|self intro test 2|admin, admin|||||0||||1|||
        members|admin|http://www.revolutionsplan.com/Trip2Blog/yabbfiles/avatars/kid.jpg|self intro test 3|admin, admin|||||0||||1|||
 



notice the spaces too ... each time there are more added than the time before

this can be fixed by changing
Code
Select All
$board = join('|', @board); 



to

Code
Select All
$board = join('|',@board); 



but it still will duplicate the Board
though without all the spaces ... I think

I can't test it tonight ...

Happy Easter to those who celebrate and Happy Sunday to those who don't
  

soundcloud.com/chimohe
Back to top
IP Logged
 
jasnner
New Member
*
Offline


Bonsai!

Posts: 49
Joined: May 31st, 2007
Gender: Male
Re: Add new board on Registration
Reply #101 - Mar 24th, 2008 at 5:45am
Print Post  
The subroutine above is for updating boards, not for adding them.

Adding boards in done in the subroutine createBoard
Code
Select All
sub createBoard{
    my ($boardExists, $existingBoard, $membCat, $bname, $bpic, $bdescription, $bmoderators, $batt, $btopicperms, $bzero);
    if($adminUseBlog){
	   $blogOwner = $_[0];
	 $blogDescription = $_[1];
	 $bpic = $_[2];

	 #Format the board id
	 $bname = $blogOwner;
	 $bname =~ s/\"/&quot;/g;
	 &FromChars($bname);

	 #if no boards already exist with that id proceed
	   if (!exists $board{"$bname"}){
	     # the default category name
	     $membCat = $blogCatName;

	     #Only create a board file if one doesn't already exists
		 opendir(BOARDSDIR, $boardsdir);
	     $boardExists = "";
		 while ($existingBoard=readdir BOARDSDIR){
		 if($existingBoard =~ m/$bname/){
		     $boardExists = "on";
		 }
	     }
		 if(!$boardExists){
		 #create a new board file
		 fopen(BOARDINFO, ">$boardsdir/$bname".'.txt');
		 print BOARDINFO '';
		 fclose(BOARDINFO);
	     }
	     #else this was a deleted board of a returning member,
	     #so restore their existing blog messages

	     #set up for write to forum control
	     if (!($bpic =~ m!http://!)){
		     $bpic = "$facesurl/$bpic";
	     }

	     #format the description
	     $bdescription = $blogDescription;
	     $bdescription =~ s!\n!<br/>!g;


	     #get the administrators for this board
	     if($ownerIsAdmin){
		 $bmoderators = "admin, $blogOwner";
	     }
	     else{
		 $bmoderators = "admin";
	     }

	     #allow attachments
	     $batt = $allowAtt;

	     #only allow admin to create topics
	     $btopicperms = $topicPerms;

	     #make posts count towards total post count
	     $bzero = $postCount;

	     #add the new board to the start of the forum.control
	     my $newBoard = t|||\n";

	     push(@allboards, $bname);


	     @boardcntrl = &loadBoards('forum.control');
	     unshift(@boardcntrl, $newBoard);
	     &saveBoards(\@boardcntrl, 'forum.control');
		 &updateForumMaster($bname);

	    }#end if board exists
     }#end if useBlog

}#end sub updateForumControl
 



This is the line that checks if the board exists
Code
Select All
 if (!exists $board{"$bname"}){
 


That lines checks the global boards array, which is already loaded into memory, for a board with the users name.
You might want to check that the first argument passed to this function is the actual member you are creating a board for, and not the current users username, as I did that earlier with $INFO{username}.

The next part
Code
Select All
 #Only create a board file if one doesn't already exists
		 opendir(BOARDSDIR, $boardsdir);
	     $boardExists = "";
		 while ($existingBoard=readdir BOARDSDIR){
		 if($existingBoard =~ m/$bname/){
		     $boardExists = "on";
		 }
	     }
 


checks the board directory for a board with the $bname, which is again the same 1st argument passed to the function. If no file with that name exists, create a file with that name.
The reason I didnt delete the board file when removing the board was so that if blog board was deleted and then restored again, the old messages where still in the restored board.

By looking at this subroutine I cannot see where how it duplicates the general board, but I think eliminating the extra spaces and using the correct username that we are creating a blog is a great start to finding the problem.

I will install a fresh board and try for myself once I find the time. Just busy with other projects and the moment, I hope I could point you in the right direction though.
« Last Edit: Mar 24th, 2008 at 12:22pm by jasnner »  

Study english, and have fun www.english-nikki.com
Back to top
WWW  
IP Logged
 
ChiMoHe
Full Member
***
Offline


I love YaBB 2.2

Posts: 197
Joined: Apr 4th, 2007
Re: Add new board on Registration
Reply #102 - Nov 25th, 2008 at 5:25am
Print Post  
any plans on updating for 2.3?
  

soundcloud.com/chimohe
Back to top
IP Logged
 
Page Index Toggle Pages: 1 ... 5 6 [7] 
Send TopicPrint