1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-03 07:36:23 -07:00

Remove old static DB prefix

This commit is contained in:
Darren VanBuren 2013-08-24 17:28:31 -07:00
parent a73c1d4410
commit 9a8d96ccbb
2 changed files with 4 additions and 4 deletions

View file

@ -717,7 +717,7 @@ var manage_functions = map[string]ManageFunction{
Callback: func() (html string) {
initTemplates()
// variables for sections table
op_posts,err := getPostArr("SELECT * FROM `ponychan_bunker_posts` WHERE `deleted_timestamp` = \""+nil_timestamp+"\" AND `parentid` = 0")
op_posts,err := getPostArr("SELECT * FROM `" + config.DBprefix + "_posts` WHERE `deleted_timestamp` = \""+nil_timestamp+"\" AND `parentid` = 0")
if err != nil {
exitWithErrorPage(writer,err.Error())
}

View file

@ -143,7 +143,7 @@ func buildBoardPage(boardid int, boards []BoardsTable, sections []interface{}) (
}
func buildThread(op_id int, board_id int) (err error) {
thread_posts,err := getPostArr("SELECT * FROM `ponychan_bunker_posts` WHERE `deleted_timestamp` = '"+nil_timestamp+"' AND (`parentid` = "+strconv.Itoa(op_id)+" OR `id` = "+strconv.Itoa(op_id)+") AND `boardid` = "+strconv.Itoa(board_id))
thread_posts,err := getPostArr("SELECT * FROM `" + config.DBprefix + "_posts` WHERE `deleted_timestamp` = '"+nil_timestamp+"' AND (`parentid` = "+strconv.Itoa(op_id)+" OR `id` = "+strconv.Itoa(op_id)+") AND `boardid` = "+strconv.Itoa(board_id))
if err != nil {
exitWithErrorPage(writer,err.Error())
}
@ -523,13 +523,13 @@ func makePost(w http.ResponseWriter, r *http.Request) {
id,_ := result.LastInsertId()
if post.ParentID > 0 {
post_arr,err := getPostArr("SELECT * FROM `ponychan_bunker_posts` WHERE `deleted_timestamp` = '"+nil_timestamp+"' AND `parentid` = "+strconv.Itoa(post.ParentID)+" AND `boardid` = "+strconv.Itoa(post.BoardID)+" LIMIT 1;")
post_arr,err := getPostArr("SELECT * FROM `" + config.DBprefix + "_posts` WHERE `deleted_timestamp` = '"+nil_timestamp+"' AND `parentid` = "+strconv.Itoa(post.ParentID)+" AND `boardid` = "+strconv.Itoa(post.BoardID)+" LIMIT 1;")
if err != nil {
exitWithErrorPage(writer,err.Error())
}
buildThread(post_arr[0].(PostTable).ParentID,post_arr[0].(PostTable).BoardID)
} else {
post_arr,err := getPostArr("SELECT * FROM `ponychan_bunker_posts` WHERE `deleted_timestamp` = '"+nil_timestamp+"' AND `parentid` = "+strconv.Itoa(post.ParentID)+" AND `boardid` = "+strconv.Itoa(post.BoardID)+" LIMIT 1;")
post_arr,err := getPostArr("SELECT * FROM `" + config.DBprefix + "_posts` WHERE `deleted_timestamp` = '"+nil_timestamp+"' AND `parentid` = "+strconv.Itoa(post.ParentID)+" AND `boardid` = "+strconv.Itoa(post.BoardID)+" LIMIT 1;")
if err != nil {
exitWithErrorPage(writer,err.Error())
}