Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 177
Total: 177

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - shuban

Pages: 1 2 [3] 4 5 ... 39
31
General SMF Forum / Re: Recording apostrophes into tables
« on: August 08, 2018, 05:20:50 pm »
That being said, I have a code that reads the URL with $_GET. Can you tell me if this is enough to protect from SQL injection?

$context['string'] = !empty($_GET['t']) ? trim(addslashes(stripslashes(un_htmlspecialchars($_GET['t'])))) : 0;

Code: [Select]
$dbresult = db_query("
SELECT column1
FROM {$db_prefix}TABLE_NAME
WHERE column1 LIKE '%".$context['string']."%'
LIMIT 1", __FILE__, __LINE__);

32
General SMF Forum / Recording apostrophes into tables
« on: August 08, 2018, 04:27:44 pm »
Is it fine to record data containing apostrophe characters rather than their HTML codes?

33
General SMF Forum / Re: SQL Query Slow (Suggestions)
« on: August 02, 2018, 10:07:47 pm »
Index only has to be added once.

Reason why I asked is because suddenly it started going slow again :-\ Prior, it would load in less than a second. Nothing has changed, coding wise.

34
General SMF Forum / Re: SQL Query Slow (Suggestions)
« on: August 02, 2018, 08:21:02 pm »
I'm curious, does this need to be done every once in a while?

35
General SMF Forum / Re: htaccess redirect question
« on: July 25, 2018, 03:03:24 pm »
Also tried:

RewriteEngine On
RewriteBase /
RewriteRule \/index\.php\?topic=(.*) https://biology-forums.com$1

But still didn't work.

36
General SMF Forum / Re: htaccess redirect question
« on: July 25, 2018, 02:07:45 pm »
technically:

Redirect: https://OLD.com/index.php?topic=282181.0 to https://NEW.com/index.php?topic=282181.0

37
General SMF Forum / Re: htaccess redirect question
« on: July 25, 2018, 02:03:47 pm »
https://regex101.com/r/o8Obr8/1

Tried the following, still don't know.

38
General SMF Forum / Re: htaccess redirect question
« on: July 25, 2018, 01:57:16 pm »
Also tried:

RewriteRule ^(.*)https:\/\/OLD\.com\/index.php\?topic=(.*)$ https://NEW.com/index.php?topic=$2 [R=301,L]

Didn't work

39
General SMF Forum / htaccess redirect question
« on: July 25, 2018, 01:47:29 pm »
I'd like to redirect all my topics (only) to another url. I tried the following, but it didn't work

RewriteEngine On
RewriteRule ^/?topic/([^/d]+)/?$ https://NEWURL.com/index.php?topic=$1 [R=301,L]

40
Did PayPal change its code since 2017? I have a version from 2017 downloaded.

41
General SMF Forum / Re: SQL Query Slow (Suggestions)
« on: July 09, 2018, 01:02:18 pm »
It now loads in less than 1 second.

I noticed the KEY is now mul. I presume that's what was altered. How come SMF doesn't come stock that way?

42
General SMF Forum / Re: SQL Query Slow (Suggestions)
« on: July 09, 2018, 12:39:30 pm »
You need to add an index on postertime

ALTER table smf_messages add index posterTime (posterTime);

How did you determine that?

43
General SMF Forum / Re: SQL Query Slow (Suggestions)
« on: July 09, 2018, 12:22:38 pm »
The explain gives:

While the describe gives:



44
General SMF Forum / SQL Query Slow (Suggestions)
« on: July 09, 2018, 11:58:04 am »
I posted this on the main SMF forum, but didn't get a favorable response. Was hoping to get SMFHack's expertise.

Code: [Select]
SELECT
mso.subject AS first_subject, ml.ID_MSG, mso.ID_MSG AS id_msg_first, ml.posterTime AS first_poster_time, t.ID_TOPIC, t.ID_BOARD, b.name AS bname,
t.numReplies, t.numViews, t.ID_MEMBER_STARTED AS id_first_member, ml.ID_MEMBER AS id_last_member,
ml.posterTime AS last_poster_time, mso.posterName AS first_poster_name,
IFNULL(meml.realName, ml.posterName) AS last_poster_name, ml.subject AS last_subject,
ml.icon AS last_icon, mso.icon AS first_icon,t.ID_POLL, t.isSticky, t.locked, ml.modifiedTime AS last_modified_time,
CASE WHEN IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG THEN 1 ELSE 0 END AS is_new, SUBSTRING(ml.body, 1, 385) AS last_body,
SUBSTRING(mso.body, 1, 385) AS first_body, ml.smileysEnabled AS last_smileys, mso.smileysEnabled AS first_smileys, t.ID_FIRST_MSG, t.ID_LAST_MSG
FROM smf_topics AS t
INNER JOIN smf_messages AS ml ON (ml.ID_MSG = t.ID_LAST_MSG)
INNER JOIN smf_messages AS mso ON (mso.ID_MSG = t.ID_FIRST_MSG)
LEFT JOIN smf_boards AS b ON (b.ID_BOARD = ml.ID_BOARD)
LEFT JOIN smf_members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)
LEFT JOIN smf_log_topics AS lt ON (lt.ID_TOPIC = ml.ID_TOPIC AND lt.ID_MEMBER = 6)
LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 6)
WHERE t.ID_BOARD IN (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 23, 24, 25, 33, 34, 35, 38, 41, 43, 48, 49, 50, 55, 59, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 95, 96, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117)
AND t.ID_LAST_MSG >= 4708323 AND ml.posterTime > unix_timestamp(now() - interval 14 day)
ORDER BY t.ID_LAST_MSG DESC
LIMIT 0, 40

Sometimes takes a minute to load, what gives?

45
General SMF Forum / Re: Knowledge base mod
« on: June 27, 2018, 07:29:33 pm »
I think I might just use the article mod you have or tiny portal's article integration

Pages: 1 2 [3] 4 5 ... 39

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal