YAFLogo

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer Topic Starter
17 years ago
Welcome to the Modifications and Patches Forum

This is the only forum that allows file uploading (max 5 megs).

Please enhance the YAF community by posting your:

  • Modifications
  • Bug fixes/Patches
  • Smiles Packs
  • Avatars Packs
  • Themes
  • Updated Language Files
  • If you are posting a Theme please attach a screen shot of the theme. For all items explain WHICH version of YAF they are designed for.

    Thanks!

    -Jaben

    Sponsor
    Jaben
    • Jaben
    • 100% (Exalted)
    • YAF Developer Topic Starter
    17 years ago
    How do you post a file?

    First, create a new topic like usual and click "Post". Then, after your new topic has been created, you click the "Attach" button on your new post. From there, you can easily upload multiple files.

    alii
    • alii
    • 50.6% (Neutral)
    • YAF Forumling
    16 years ago
    Where can I have file for translating from English?
    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago
    Simply patch for data layer.

    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago
    Simply patch for data layer.
    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago
    A patch to begin separate data layer remnants from core code(harmless one).

    On applying, the /YetAnotherForum.Net/ folder will be completly cleared from MS SQL database code. And it's completly safe and tested.

    After this all the DB related code should be separated at last:-d .

    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago
    Missing conversion hacks for other data layers

    RavenDev
    • RavenDev
    • 51.2% (Neutral)
    • YAF Forumling
    15 years ago
    Lithuanian Language

    my forum at web adress www.ravendev.lt/forum

    test2005
    15 years ago

    Lithuanian Language

    my forum at web adress www.ravendev.lt/forum

    RavenDev wrote:

    Thanks for the contribution! :)


    .....the man in black fled across the desert..........and the gunslinger followed.....

    RavenDev
    • RavenDev
    • 51.2% (Neutral)
    • YAF Forumling
    15 years ago
    from my forum you can get image files with Lithuanian language
    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago
    The proposed patch to make all data layers almost safe proof compatable in future.

    It's for MS SQL data layer, but the only difference is in the DBAccess.cs file and class CoolCoverter.

    For MySQL it reads for any data layer like this^

    public static class CoolConverter

    {

    public static int VerifyInt32(object value)

    {

    if (value == DBNull.Value) return 0;

    return Convert.ToInt32(value);

    }

    public static bool VeryfyBool(object value)

    {

    if (value == DBNull.Value || value.ToString() == "0") return false;

    if ( value.ToString() == "1") return true;

    return Convert.ToBoolean(value);

    }

    }

    For postgreSQL it's like this

    public static class CoolConverter

    {

    public static int VerifyInt32(object o)

    {

    //if (o == DBNull.Value || o =="f" ) o = 0;

    // if (o == "t") o = 1;

    return Convert.ToInt32(o);

    }

    public static bool VeryfyBool(object o)

    {

    if (o.ToString() == "t") { return true; }

    if (o.ToString() == "f") { return false; }

    return false;

    }

    }

    For MS SQL Server it's simply

    public static class CoolConverter

    + {

    + public static int VerifyInt32(object o)

    + {

    + return (int)o;

    + }

    + public static bool VeryfyBool(object o)

    + {

    + return (bool)o;

    + }

    + }

    In the last case it's much more faster than using Convert.ToInt32 or Convert.ToBool :wink:

    Jaben
    • Jaben
    • 100% (Exalted)
    • YAF Developer Topic Starter
    15 years ago
    On little thing... I have to change the name to "SqlDataLayerConverter".

    CoolConverter just isn't proper naming for the class.

    Thank you for all your help though, bbobb.

    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago

    On little thing... I have to change the name to "SqlDataLayerConverter".

    CoolConverter just isn't proper naming for the class.

    Jaben wrote:

    No matter, it was a temporary example class name anyway. I wait while it appears and verify data layers again to avoid any possible bugs.

    Thanks that you found time for it:)

    bbobb
    • bbobb
    • 100% (Exalted)
    • YAF Developer
    15 years ago
    No, I was wrong.

    The class for MSSQL

    public static class SqlDataLayerConverter

    + {

    + public static int VerifyInt32(object o)

    + {

    + return (int)o;

    + }

    + public static bool VeryfyBool(object o)

    + {

    + return (bool)o;

    + }

    + }

    doesn't work, because unboxing doesn't work safe in the case though it's fast.

    Convert.To... should be used anyway:cry:

    This makes boxing of DataRow value which is already filled by a value.

    I was somehow completly sure that it should work.

    And it's impossible to make dynamic conversion class without code deep changing in many places.

    Sorry.

    Jaben
    • Jaben
    • 100% (Exalted)
    • YAF Developer Topic Starter
    15 years ago
    Interestingly, I haven't applied the conversion code yet. So I'll just hold off for now. I did apply the data layer centralization changes.