Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
custom-topic
Moving comments to forum
Avatar
Chris_Andrews
Member
sp_UserOfflineSmall Offline
Jul 20, 2017 - 9:35 am
sp_QuotePost Quote

It very well might.... it's more that I'm not sure how to use it -

***
News For Shoppers is seeking consumer reporters,
consumer advocates, and entertainment writers:
visit: NewsForShoppers.com/write/

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 20, 2017 - 9:48 pm
sp_QuotePost Quote

do you have a specific question?  or section that is not understood?

Avatar
Chris_Andrews
Member
sp_UserOfflineSmall Offline
Jul 21, 2017 - 10:10 am
sp_QuotePost Quote

No, I don't really have a starting point on how to use it.

If I would put it in a new script? and how to get the data to it....? 

***
News For Shoppers is seeking consumer reporters,
consumer advocates, and entertainment writers:
visit: NewsForShoppers.com/write/

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 22, 2017 - 8:56 am
sp_QuotePost Quote

As I said in post #2 - you were pretty much there up until the post save. The code I have pointed you to ensures that part of it is performs properly. Although I would add that one thing you did not say in post #1 was to ensure you tackle the comments in ID order as  the order they are saved in will be reflected in the forum topic sequence.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris_Andrews
Member
sp_UserOfflineSmall Offline
Jul 23, 2017 - 5:14 pm
sp_QuotePost Quote

Ok, so I'm thinking I need to get the data from the comments table, then the sflinks table, and if there is a link, then I would use the function by feeding it the data? 

So, right now, I'm working on getting the comments data (that works). Then the information from sflinks.... but for some reason I'm not getting that information. 

Do you see what I am doing wrong here?  Thanks for your help ahead of time!

<?php 

//load wp

require_once("wp-load.php");

//get comments

$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments LIMIT 7") );

foreach ($comments as $comment) {

$comment_post_ID = $comment->comment_post_ID;

//do I have the comments info?

echo $comment_post_ID."<br />"; //YES!

 //find and get data from sflinks

$links = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->sflinks WHERE post_id = $comment_post_ID" ) );

$link_info = $links->topic_id."<br />";

 //do I have the info from sflinks?

echo $link_info."<br /><br />"; //NO

}

?>

***
News For Shoppers is seeking consumer reporters,
consumer advocates, and entertainment writers:
visit: NewsForShoppers.com/write/

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 24, 2017 - 1:52 am
sp_QuotePost Quote

First off - answering an earlier query - a comment edit will not create a forum post. It is created on a comment publish action.

As to the above then you can not use $wpdb->sflinks as only WP core tables are recognised in that construct.

Instead use the main sp_blog_links_control() function that is in the blog linking main plugin file - using an action of 'read'.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 638
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 615
Members: 17342
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10114
Posts: 79573