Results 1 to 12 of 12

Thread: [socialmedialinks] Social Media Links

  1. #1
    User
    Join Date
    06-20-09.
    Location
    Middlesbrough, UK
    Posts
    246

    Default [socialmedialinks] Social Media Links

    This is the support section for the Social media links module.

    If any native German speakers would like to translate this module please let me know. I have just used Google translate which isn't always the best sollution.

    You can post bus and feature requests here: http://contao-forge.org/projects/soc...ialinks/issues

    ***If you use the default list it will need to be initialised before adding it as a module to a page. Do this by Select Social Media List from the side column***

    Instructions

    Install Social Media Module

    Select Social Media List from the side column

    Create New Social Media Link

    Fill out fields
    e.g.:
    Facebook
    http://en-gb.facebook.com/360fusionLtd
    Find us on Facebook
    Tick Publish
    Save and Close

    Select Icon Packs from the side column

    Create New Icon Pack (Icon packs are used to group icons, for use in the header together with different icons else where on the website.)

    Give the Icon pack a name
    Choose the folder with the icons
    Save to refresh icon list
    Using the multicolumn tree pair up the icons with the names.
    Save and Close

    Select Groups from the side column (under social media)
    Name the group
    enter the height and width of each icon
    choose the icon pack
    Add the social icons you wish to display in the frontend.

    Create new module (Social Media)
    select template
    select social media group
    save and close

    Add module to article or page layout

    Thanks
    Ben
    360fusion: Virtual Tours - Web Design
    Social Media: Twitter - Facebook Page

  2. #2
    New user respinar's Avatar
    Join Date
    09-17-10.
    Location
    Tabriz, Iran
    Posts
    14

    Default Re: [socialmedialinks] Social Media Links

    Hi,

    I installed this extenstion on my contao version 2.11.3, but it return "request failed" error.

    Code:
    Warning: mysql_query() [function.mysql-query]: Access denied for user 'xusernamex'@'localhost' (using password: NO) in /home/payamfaj/public_html/system/modules/socialmedialinks/socialmedialinks.php on line 22
    
    #0 [internal function]: __error(2, 'mysql_query() [...', '/home/payamfaj/...', 22, Array)
    #1 /home/payamfaj/public_html/system/modules/socialmedialinks/socialmedialinks.php(22): mysql_query('select * from t...')
    #2 /home/payamfaj/public_html/system/modules/backend/BackendModule.php(114): socialmedialinks->compile()
    #3 /home/payamfaj/public_html/system/modules/backend/Backend.php(239): BackendModule->generate()
    #4 /home/payamfaj/public_html/contao/main.php(120): Backend->getBackendModule('sml_settings')
    #5 /home/payamfaj/public_html/contao/main.php(230): Main->run()
    #6 {main}
    
    
    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/payamfaj/public_html/system/modules/socialmedialinks/socialmedialinks.php on line 22
    
    #0 [internal function]: __error(2, 'mysql_query() [...', '/home/payamfaj/...', 22, Array)
    #1 /home/payamfaj/public_html/system/modules/socialmedialinks/socialmedialinks.php(22): mysql_query('select * from t...')
    #2 /home/payamfaj/public_html/system/modules/backend/BackendModule.php(114): socialmedialinks->compile()
    #3 /home/payamfaj/public_html/system/modules/backend/Backend.php(239): BackendModule->generate()
    #4 /home/payamfaj/public_html/contao/main.php(120): Backend->getBackendModule('sml_settings')
    #5 /home/payamfaj/public_html/contao/main.php(230): Main->run()
    #6 {main}
    
    request failed



    this is installed extenstion:

    [BackupDB] Backup Database
    [calendar] Events
    [comments] Comments
    [cron] Scheduler
    [dlh_googlemaps] Google Maps
    [downloadarchive]
    [faq] FAQ
    [favicon] Display Favicon for pages
    [googleanalytics] Integration of Google Analytics
    [linklist] Link collection
    [listing] Listing
    [mooquee4ward]
    [multicolumnwizard]
    [newsletter] Newsletters
    [news] News
    [parentslist]
    [registration] User registration
    [rep_base] Repository base
    [rep_client] Repository client
    [rss_reader] RSS reader
    [socialmedialinks]
    [tasks] Task center
    [tpl_editor] Templates
    [x-seo]
    Hamid Abbaszadeh
    https://respinar.com

  3. #3
    New user
    Join Date
    02-24-12.
    Posts
    19

    Default Re: [socialmedialinks] Social Media Links

    This is the part of the code where the module is setting the default values in the database. It seems it can't connect to the database or find the table.
    Have you updated the tables after you installed the module ?
    Are you on an admin account ?

    Thanks for your feedback

  4. #4
    New user
    Join Date
    02-24-12.
    Posts
    19

    Default Re: [socialmedialinks] Social Media Links

    I have updated the file 'socialmedialinks.php', can you please replace it in system/modules/socialmedialinks/, try it and let me know if it is working now ?

    Thank you very much

  5. #5
    New user respinar's Avatar
    Join Date
    09-17-10.
    Location
    Tabriz, Iran
    Posts
    14

    Default Re: [socialmedialinks] Social Media Links

    Hi,

    Now, it's work in content, but when I try to create a module it return this error:

    Code:
    Warning: mysql_query() [function.mysql-query]: Access denied for user 'xusernamex'@'localhost' (using password: NO) in /home/respinar/public_html/system/modules/socialmedialinks/dca/tl_module.php on line 58
    
    #0 [internal function]: __error(2, 'mysql_query() [...', '/home/respinar/...', 58, Array)
    #1 /home/respinar/public_html/system/modules/socialmedialinks/dca/tl_module.php(58): mysql_query('select * from t...')
    #2 /home/respinar/public_html/system/libraries/Controller.php(2851): tl_module_SocialMedia->getSocialMediaGroup(Object(DC_Table))
    #3 /home/respinar/public_html/system/modules/backend/DataContainer.php(252): Controller->prepareForWidget(Array, 'SocialMedia_Gro...', '', 'SocialMedia_Gro...', 'tl_module')
    #4 /home/respinar/public_html/system/drivers/DC_Table.php(1748): DataContainer->row('{title_legend},...')
    #5 /home/respinar/public_html/system/modules/backend/Backend.php(287): DC_Table->edit()
    #6 /home/respinar/public_html/contao/main.php(120): Backend->getBackendModule('themes')
    #7 /home/respinar/public_html/contao/main.php(230): Main->run()
    #8 {main}
    
    
    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/respinar/public_html/system/modules/socialmedialinks/dca/tl_module.php on line 58
    
    #0 [internal function]: __error(2, 'mysql_query() [...', '/home/respinar/...', 58, Array)
    #1 /home/respinar/public_html/system/modules/socialmedialinks/dca/tl_module.php(58): mysql_query('select * from t...')
    #2 /home/respinar/public_html/system/libraries/Controller.php(2851): tl_module_SocialMedia->getSocialMediaGroup(Object(DC_Table))
    #3 /home/respinar/public_html/system/modules/backend/DataContainer.php(252): Controller->prepareForWidget(Array, 'SocialMedia_Gro...', '', 'SocialMedia_Gro...', 'tl_module')
    #4 /home/respinar/public_html/system/drivers/DC_Table.php(1748): DataContainer->row('{title_legend},...')
    #5 /home/respinar/public_html/system/modules/backend/Backend.php(287): DC_Table->edit()
    #6 /home/respinar/public_html/contao/main.php(120): Backend->getBackendModule('themes')
    #7 /home/respinar/public_html/contao/main.php(230): Main->run()
    #8 {main}
    
    request 0 failed
    Also, I must mention that, these error is occur in some installation, I have about 30 contao website.

    I think I found the problem of this extenstion: MySQLi, this only work with MySQL driver, by chaning this driver from MySQLi to MySQL everything become right.


    Thanks
    Hamid Abbaszadeh
    https://respinar.com

  6. #6
    New user
    Join Date
    02-24-12.
    Posts
    19

    Default Re: [socialmedialinks] Social Media Links

    Indeed, I built it without thinking of other RDBMS than mysql which is the one we use. I ll update it and replace the mysql requests with PDO on the next update to make it flexible.

    Thank you for your feedback.

  7. #7
    New user
    Join Date
    02-24-12.
    Posts
    19

    Default Re: [socialmedialinks] Social Media Links

    The new version we just released should work with any system, let us know, thank you !

  8. #8
    New user respinar's Avatar
    Join Date
    09-17-10.
    Location
    Tabriz, Iran
    Posts
    14

    Default Re: [socialmedialinks] Social Media Links

    Hi,

    Why you don't want this extenstion to be like other extentions in using SQL.

    PDO version do not work because of my host configuration.
    Hamid Abbaszadeh
    https://respinar.com

  9. #9
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: [socialmedialinks] Social Media Links

    Hi,

    you shouldn't really use mysql_query(), mysqli_query() or PDO in Contao extenstions.

    The 'proper' way to do it is to use Contao's Database object. This will solve any conneciton issues as it will already be configured by the user to work with whatever database they are using.

    You use it like this:

    Code:
    $objResult = $this->Database->query('SELECT * FROM tl_page');
    Or for prepared statements like this:

    Code:
    $objResult = $this->Database->prepare('SELECT * FROM tl_page WHERE id = ?')->execute($page_id);
    You can then get the results set by looping through the object returned:

    Code:
    while($objResult->next())
    {
        echo $objResult->title; // For the first query above this would output the title of each page
    }
    If you ever get stuck just take a look into another Contao extension as this is how all Database interaction is done. The database object ($this->Database) is automatically available inside any class that extends the Contao core classes (Module, Backend, Frontend, Controller, etc...). If for whatever reason it isn't available you can import it by using $this->import('Database').

    I hope this helps!

  10. #10
    New user
    Join Date
    02-24-12.
    Posts
    19

    Default Re: [socialmedialinks] Social Media Links

    Hello,

    I just realised that indeed I wasn t using the proper syntax, and we just released a new version doing exactly what you just said, punkstjimmy.

    I hope that this time it will be working for you respinar.

    Regards

  11. #11
    New user respinar's Avatar
    Join Date
    09-17-10.
    Location
    Tabriz, Iran
    Posts
    14

    Default Re: [socialmedialinks] Social Media Links

    Hi,

    Thanks, It work properly.

    Best regards
    Hamid Abbaszadeh
    https://respinar.com

  12. #12
    New user
    Join Date
    09-21-12.
    Posts
    1

    Default Re: [socialmedialinks] Social Media Links

    Hi Ben,

    I use socialmedialinks for the first time, very nice, thank you.
    Can you please change the part for headlines in the frontend templates.
    Code:
    <?php if ($this->hasHeadline): ?>
        <<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
    <?php endif; ?>
    Thanks.
    André

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •