corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Unsure if anyone can help me with this » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Steve

posted on 4th Oct 06 at 19:49

thread dump is completed, now tells you when it was trashed and who by :thumbs:

also stopped it from showing in the results from show posts since last visit


Steve

posted on 4th Oct 06 at 12:35

got it working with the SQL query cheers ian


Ian

posted on 3rd Oct 06 at 19:13

That would work, its an extra query and I would make double sure you don't already have it in memory somewhere before you query for it, but if you don't then yeah, that would sort it.


Steve

posted on 3rd Oct 06 at 19:08

i was thinking about doing an sql query to get


Ian

posted on 3rd Oct 06 at 19:04

The ways its done here is that the forum id becomes that of the trash - in this case 29 - and thats the only change in the posts and threads tables.

At this time it also writes the thread id and a reason to another table.

Its forumdisplay and viewthread where the difference happens, they don't allow regular members to view threads with that forum id.

Forumdisplay also does the join now with the posts in fid=29 and the reasons table to get that.

What you're needing to do means you need the thread title available to you when you process the move, which you probably have, if all else fails throw a select in there and get it.


Steve

posted on 3rd Oct 06 at 17:08

if you cant be arsed to design your own layout etc then you can quickly apply themes from
http://www.phpbb-design.com/


John

posted on 3rd Oct 06 at 17:02

Cheers.
Thats plenty to get me going :thumbs:


Steve

posted on 3rd Oct 06 at 16:56

http://www.phpbb.com/downloads.php

will get you the basic stuff of what mines running on. This forum is XMB unsure if xmb is free, phpbb is free.

Bear in mind mine and this is very modified so wont look like it out the box or have half the functions but its a good start


John

posted on 3rd Oct 06 at 16:53

Yip, your forum or here for instance.


Steve

posted on 3rd Oct 06 at 16:52

something like what going? a forum?


John

posted on 3rd Oct 06 at 16:50

Sorry to crash your post steve but I don't have a clue.

I would however like to.

What do I need to get something like this going.

I know there will be millions on google but i'll look into things further when I have a basic idea of what i'm looking for.


Steve

posted on 3rd Oct 06 at 16:24

i did try that one of the first things i did and got

Warning: Missing argument 9 for delete_post() in /home/sites/vagweb.co.uk/public_html/forums/includes/functions_post.php on line 469


Cosmo

posted on 3rd Oct 06 at 16:12

wrong forum, this should be in uber geek day :|


James

posted on 3rd Oct 06 at 16:03

Well you dont need to change it, just pass in topic_title instead.

Where you've got this:

code:

function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id)


Change it to this:

code:

function delete_post($mode, $post_data, $message, $meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_title)


And then when the delete_post function is called (looks like this):

code:

delete_post("parameter1", "parameter2", "parameter3", "parameter4", "parameter5", "parameter6",
"parameter7", "parameter8", "topic title")



And then where it does this insert:

code:

$sql = "INSERT INTO " . TOPICS_TABLE . "
(forum_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_status, topic_vote, topic_type, topic_first_post_id, topic_last_post_id, topic_moved_id)
******VALUES (".$board_config['delete_post_forum'].", '".sprintf($lang['Deleted_post_from_topic'], $topic_id*******)."', ".$post_data['poster_id'].", ".time().", 0, 0, ".TOPIC_UNLOCKED.", 0, ".POST_NORMAL.", $post_id, $post_id, 0)";



Change it to this

code:

$sql = "INSERT INTO " . TOPICS_TABLE . "
(forum_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_status, topic_vote, topic_type, topic_first_post_id, topic_last_post_id, topic_moved_id)
******VALUES (".$board_config['delete_post_forum'].", '".sprintf($lang['Deleted_post_from_topic'], $topic_title*******)."', ".$post_data['poster_id'].", ".time().", 0, 0, ".TOPIC_UNLOCKED.", 0, ".POST_NORMAL.", $post_id, $post_id, 0)";



Do you get me? :look:



[Edited on 03-10-2006 by James]


Steve

posted on 3rd Oct 06 at 16:02

i cant even find where $topic_id is set in that php document, it may be a superglobal declared elsewhere


Steve

posted on 3rd Oct 06 at 15:59

the problem is topic_id is set for many different functions, changing it would mean screwing up a lot of things


James

posted on 3rd Oct 06 at 15:49

Yeah but when the Delete_Post function is called, the topic_id is passed in as a paramater which is then used in that insert query, if you could just pass in the topic title as a parameter instead, you could use that?


Steve

posted on 3rd Oct 06 at 15:47

thats almost the whole function there, $topic_title is part of a different function, even if i make the variable global it still doesnt pick it up.

topic_title is made by

$topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);

utilising bits and bobs from other functions


James

posted on 3rd Oct 06 at 15:43

Can you post the code where $topic_id is passed into that function?

I reckon you can just pass in topic title instead....


Steve

posted on 3rd Oct 06 at 15:28

gets nothing, topic_title on what you can see is just the name of the SQL table


James

posted on 3rd Oct 06 at 15:23

What happened when you replaced topic_id with topic_title?


Steve

posted on 3rd Oct 06 at 14:11

Iv made it so when a user deletes a post it just moves it to another forum (the thread dump).

http://www.vagweb.co.uk/forums/viewforum.php?f=20 (need to be registered)


When it moves it i get it to rename the Post title to 'Deleted from topic-ID 444' for example.

Now i want to rename it to 'Deleted from topic title' instead

The functions for this reside in fucntions_post.php and here is the snippet of code for the function wthin that does the moving

code:
function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx, $topic_title;
global $userdata, $user_ip;
if (intval($board_config['delete_post_forum']) != 0)
{
$sql = "SELECT * FROM " . FORUMS_TABLE . "
WHERE forum_id = " . $board_config['delete_post_forum'];
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}
$forum_count = $db->sql_numrows($result);
$db->sql_freeresult($result);

$forum_check = ($forum_count != 0) ? TRUE : 0;
}
else
{
$forum_check = 0;
}

if ($mode != 'poll_delete')
{
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
if ($userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD && $board_config['mod_allow_delete_post'] == 1))
{

$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $post_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE FROM " . POSTS_TEXT_TABLE . "
WHERE post_id = $post_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}
}
else if ($post_data['first_post'] == '' && $forum_check == TRUE)
{

$sql = "INSERT INTO " . TOPICS_TABLE . "
(forum_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_status, topic_vote, topic_type, topic_first_post_id, topic_last_post_id, topic_moved_id)
******VALUES (".$board_config['delete_post_forum'].", '".sprintf($lang['Deleted_post_from_topic'], $topic_id*******)."', ".$post_data['poster_id'].", ".time().", 0, 0, ".TOPIC_UNLOCKED.", 0, ".POST_NORMAL.", $post_id, $post_id, 0)";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}
$new_topic_id = $db->sql_nextid();

$sql = "UPDATE " . POSTS_TABLE . "
SET topic_id = $new_topic_id, forum_id = ".$board_config['delete_post_forum']."
WHERE post_id = $post_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}
}


i have made in ******'s the line that sets the post title as it stands.

Iv tried the obvious and replaced $topic_id with $topic_title that is declared elsewhere in the php but that dont work :(