Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 02-05-2013, 05:34 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand why that would happen. It looks like everything's right. Maybe try this: find this code (around line 305):

Code:
	// create data manager
	if ($type == 'thread')
	{
		$dataman =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
		$dataman->set('prefixid', $post['prefixid']);
	}

Then add your set call in there, like this:

Code:
	// create data manager
	if ($type == 'thread')
	{
		$dataman =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
		$dataman->set('prefixid', $post['prefixid']);
		$dataman->set('authorship', $post['authorship']);
	}
Reply With Quote
  #12  
Old 02-05-2013, 05:40 PM
glennybee glennybee is offline
 
Join Date: Feb 2008
Location: Scotland
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think we're getting closer... database error now
Code:
Database error in vBulletin 3.8.7:

Invalid SQL:
INSERT INTO post
	(authorship, showsignature, allowsmilie, username, userid, title, pagetext, iconid, visible, dateline, ipaddress, attach, threadid)
VALUES
	(1, 1, 1, 'MME\'s Alan', 3, 'checked box test', 'testing checked box', 0, 1, 1360089531, '', 0, 463);

MySQL Error   : Unknown column 'authorship' in 'field list'
Error Number  : 1054
Request Date  : Tuesday, February 5th 2013 @ 12:38:51 PM
Error Date    : Tuesday, February 5th 2013 @ 12:38:51 PM
Script        : http://www.moneymakingexperts.org/newthread.php?do=postthread&f=12
Referrer      : http://www.moneymakingexperts.org/newthread.php?do=newthread&f=12
IP Address    : 94.171.60.130
Username      : MME's Alan
Classname     : vB_Database_MySQLi
MySQL Version : 5.5.23-55
Reply With Quote
  #13  
Old 02-05-2013, 05:48 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, now you have to create the column in your database. Do you have phpMyAdmin? Go to the database, click on the thread table then the structure tab, then look for the "Add 1 column(s)" line below the list of columns, and click "go". Then put in 'authorship' for the name and probably select tinyint from the type list. I don't think you need to set any of the other fields.
Reply With Quote
  #14  
Old 02-05-2013, 05:50 PM
glennybee glennybee is offline
 
Join Date: Feb 2008
Location: Scotland
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So from looking at this i need to add the column "authorship" to the "post" database in mysql...

Off to figure out how to do that haha
Reply With Quote
  #15  
Old 02-05-2013, 05:52 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually I think you want to add it to "thread", right? (If you only want it selected for each thread and not for every post).
Reply With Quote
  #16  
Old 02-05-2013, 05:55 PM
glennybee glennybee is offline
 
Join Date: Feb 2008
Location: Scotland
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cheers mate, ive added it to the post table, as this seemed to be where the other columns were that were named in the error, should it be the thread table?

Its working now, but its not working hehe.

Think it must be just a bit of tweaking in the postbit legacy template now

--------------- Added [DATE]1360090631[/DATE] at [TIME]1360090631[/TIME] ---------------

the thread table just contains all the data for the threads, its the post table that has the showsignature columns etc.
It will only be an option on the first thread post so i think its ok...

--------------- Added [DATE]1360090719[/DATE] at [TIME]1360090719[/TIME] ---------------

I think its just this bit of code now in the postbit_legacy template...

Code:
<if condition="$show['authorship']">
How can i tell this, if authorship is '1'??

--------------- Added [DATE]1360091099[/DATE] at [TIME]1360091099[/TIME] ---------------

I think ive got it... changed the $show to $post...

--------------- Added [DATE]1360091218[/DATE] at [TIME]1360091218[/TIME] ---------------

this is the result...

authorship box checked...
Code:
http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fwww.moneymakingexperts.org%2Ff12%2Fauthor-box-checked-465%2F&html=
not checked...

Code:
http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fwww.moneymakingexperts.org%2Ff12%2Fnot-checked-466%2F&html=
I owe you a beer mate... whats you paypal and i'll send you a small token of my appreciation
Reply With Quote
  #17  
Old 02-05-2013, 06:09 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, if you put it in post and it's working that's OK. If it's only for the first post you really should have put it in thread, but the only issue is that it takes up a bit more database space.

I'm kind of surprised that it's working because I think the default when you add fields to the Thread_firstpost datamanager is to have them be thread table fields. But again, as long as it's working for you, it doesn't matter.
Reply With Quote
  #18  
Old 02-05-2013, 06:13 PM
glennybee glennybee is offline
 
Join Date: Feb 2008
Location: Scotland
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah its working so im mega happy.

I just need to add the option to edit thread, this might be a bit more complicated if editing a post that isnt the first post of the thread.

Do you think i should add it to the thread table then? if i done that, surely the code weve added is adding the variable to the post table, how would we tell it to add it to the thread table?

--------------- Added [DATE]1360091710[/DATE] at [TIME]1360091710[/TIME] ---------------

Maybe i just need to add a if postid=1 variable to the if statement on the newthread template where it displays the check box option to claim authorship

--------------- Added [DATE]1360092034[/DATE] at [TIME]1360092034[/TIME] ---------------

hhmmm i had added this code to the editpost template thinking that would have cracked it, but the option isnt showing up with this if statement.

Any ideas

Code:
<if condition="$post[postcount] == 1"><div><label for="authorship"><input type="checkbox" name="authorship" value="1" id="authorship" tabindex="1" $checked[authorship] />Claim google authorship</label></div></if>
--------------- Added [DATE]1360094899[/DATE] at [TIME]1360094899[/TIME] ---------------

I know you have helped me immensly, im just trying to tidy up these loose ends.

I'm trying to add it to the edit post page, ive added the same code as i did in the postbit_legacy, but when i check the box to claim authorship, it doesnt set the authorship field in the post table to '1'.

Any ideas?

Let me know your paypal email and i will send you something as a small token of my appreciation for helping me with that.

--------------- Added [DATE]1360098744[/DATE] at [TIME]1360098744[/TIME] ---------------

Ive added the 2 lines i need to in editpost.php, the same as i did in newthred.php, but cant find where i should be doing this dataman part.
Reply With Quote
  #19  
Old 02-05-2013, 10:20 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I had to be away for a while. Anyway, the dataman part is in the editpost.php file, starting around line 176. It's a little different than creating a new post - it's doesn't have that extra layer of call to build_new_post(). It just goes from $vbulletin->GPC[] right to setting the dataman fields. (Well, actually it sets a $edit array then sets the dataman from that, but it's all in the same file).
Reply With Quote
  #20  
Old 02-06-2013, 04:45 PM
glennybee glennybee is offline
 
Join Date: Feb 2008
Location: Scotland
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yay!! sorted, all working good!

Again... thanks a million
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04184 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete