Log in

View Full Version : [SURVEY]Would You prefer a hack with or without files modifications ?


grog6
10-30-2005, 06:20 PM
Hi everybody

I'm doing a new hack (PYNFATYF Hack) but I'm in front of a big problem ...

You probably know that now, with vb 3.5 you can add hacks to your forum without modifying at all any file, just upload at least one file, import a XML and you're done

So, it's really easier to upgrade your forum, it's faster to install :bandit:

But I'd like to know what people really think about it ...

Would you prefer a hack (a big hack) with file modifications to try decreasing the number of queries that this hack adds, or would you prefer a hack without files modifications at all, so, easy and fast to install (even when you upgrade your board)

I'm waiting for your answers :)

Andreas
10-30-2005, 06:35 PM
I prefer edit-free Hacks that don't add overhead :)

In (rare) cases where this is not possible, one must decide if the overhead is worth it or not.

If it happens often (eg. forumdisplay, showthread, etc): Move on and edit the file.
If it is seldom (for example when the user updates his profile or smth.), introduce a new query.

grog6
10-30-2005, 06:39 PM
Andrea I'm sure you know that sometimes we have no choice and we need to get back some new datas ... and so we need new queries ... or try modifying an existing query to get these datas through an existing query (even it slows down the forum too ...) ;)

Ok for the edit ;)
In my case, it concerns showthread and even if I can modify an existing query, I'm sure it would reduce the load time, so what to do ? :ermm:

Andreas
10-30-2005, 06:45 PM
What exactly would be your file edit?

Paul M
10-30-2005, 06:48 PM
What is PYNFATYF ?

Anyway, an extra query or two is generally neither here nor there, people worry too much about them.

The one hack I have left to release requires a query and a bit of code to be duplicated because of the location of the hooks, but that's life. :)

grog6
10-30-2005, 06:50 PM
I don't exactly know for now, but I need to get back datas from a new table (SELECT * if I use hooks, if I modify the file, I'll have to linked some tables in an existing query) in showthread

And surely an other one to get back a new field I should have to add to the attachment table (for this one it's better to modify the existing query I think)

amykhar
10-30-2005, 06:55 PM
Personally, I would rather have the file edits and have the code more optimized. So many users are on shared servers with limited resources, which makes optimization key.

Amy

grog6
10-30-2005, 06:58 PM
Paul : PYNFATYF is for Personalize Your Newthread Form According To Your Forum

Andreas
10-30-2005, 07:03 PM
The two most important queries in showthrad.php (to get the IDs and the actual posts) can be modified without editing the files.

grog6
10-30-2005, 07:06 PM
The two most important queries in showthrad.php (to get the IDs and the actual posts) can be modified without editing the files.

How ? :surprised:

Andreas
10-30-2005, 07:07 PM
Hooks showthread_query_postids and showthread_query

grog6
10-30-2005, 07:11 PM
But how can I modify this query with the hook ?

If I add a query to this hook, it's the same thing that if I added it to the file ?
How could I modify the query in the file ? I don't understand ...

amykhar
10-30-2005, 07:13 PM
It allows you to add extra columns to the query without adding a new query.

grog6
10-30-2005, 07:15 PM
An example amy ? :)

You're interesting me !

Andreas
10-30-2005, 07:21 PM
You can use the variables $hook_query_fields to add new fields, $hook_query_joins to add joins and $hook_query_where to add conditions.

Example

$hook_query_fields .= ", mytable.foobar1, mytable.foobar2";
$hook_query_joins .= " JOIN " . TABLE_PREFIX . "mytable ON (mytable.userid=user.userid)";

grog6
10-30-2005, 07:26 PM
Thanks Andreas :)

Can this (by replacing variable's name) be done in every hook ?

How could I have known it if you had not said it to me ? Isn't there a guide "the perferct vbulletin hacker's guide ?" ;)

Andreas
10-30-2005, 07:34 PM
No, only in special query Hooks.

Well, you could just take a look at the source files - they are fully documented and the query Hooks as well as the variables are clearly visible there ;)

grog6
10-30-2005, 07:45 PM
OK, thank you

Other replies for the survey now, else my thread will be moved to an other forum ... :p