News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF Links

Started by SMFHacks.com Team, July 12, 2006, 12:33:28 AM

Previous topic - Next topic

FrizzleFried

Quote from: vbgamer45 on May 14, 2022, 10:45:23 AMFixed thanks for the report.

Not sure if you meant that the BACK issue was fixed.  As I just checked and clicking the BACK button on your browser DOES retain the info ... but clicking BACK on the page and you lose the entry.

Icons are now showing.  Main page column alignment could be improved... (see below).

Thanks for updating to 2.1!


vbgamer45

It was just the icon/gif fixed
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Shades.

I've always liked this mod thanks for updating it! 8)

Any chance you can add the ability to add an image (logo or banner) per link in a future update? O:)

I know, we always want more huh!? ::)  ;D
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

mickjav

Quote from: Shades. on May 14, 2022, 12:39:01 PMAny chance you can add the ability to add an image (logo or banner) per link in a future update? O:) 

Somebodies been peaking at my Wishlist  ;D  ;D

vbgamer45

I can't believe you guys like it so much lol.
This is one of my poorer mods, along the articles one.
Mainly because I don't have a premium version of it/lack of time to update it/add features.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Should you find time to create a premium version I'll let you peak at my Wishlist  ;D  ;D  ;D   

Oldiesmann

A couple of bugs relating to category order:
In the admin center, categories are shown in a different order than on the links page
Trying to move a category up doesn't work - you just get an error saying "No category selected"
Michael Eshom
Christian Metal Fans

vbgamer45

Quote from: Oldiesmann on May 16, 2022, 09:52:26 PMA couple of bugs relating to category order:
In the admin center, categories are shown in a different order than on the links page
Trying to move a category up doesn't work - you just get an error saying "No category selected"
Fixed both issues new release posted SMF Links 4.0.1
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Oldiesmann

Found another issue. Trying to sort links doesn't work - you click on a column and links are still shown in the same order (date added) regardless of which column you click on.
Michael Eshom
Christian Metal Fans

_sebas_

Does anyone know how SEO is currently for own and external links?

mickjav

My Version: 4.0.1

Just imported links to my links table and while testing.

I noticed the sorting for any category doesn't work , I've tried different categories with same result

Also made some edits to the links' table, adding index to ID_CAT & ID_MEMBER

I did have a look at links.2.php

The only thing I'm not sure about is:

on line 154
}
else
$sort = 'l.ID_LINK';

I may be missing something and probably am, but is the above needed if the switch has a default?

if (!empty($_REQUEST['sort']))
{
switch($_REQUEST['sort'])
{
case 'title':
$sort = 'l.title';
break;
case 'date':
$sort = 'l.date';
break;
case 'rating':
$sort = 'l.rating';
break;
case 'hits':
$sort = 'l.hits';
break;
case 'username':
$sort = 'm.real_name';
break;
default:
$sort = 'l.ID_LINK';
}
}
else
$sort = 'l.ID_LINK';



mickjav

#1191
Think I just found an Unneeded Query

        GetCatPermission($cat, 'view');
        // List all the catagories
        $dbresult = $smcFunc['db_query']('', '
            SELECT title, ID_CAT, art_id
            FROM {db_prefix}links_cat
            WHERE ID_CAT = {int:this_cat}
            LIMIT 1',
            array(
                'this_cat' => $cat
            )
        );
        $row = $smcFunc['db_fetch_assoc']($dbresult);
       
        if (empty($row['ID_CAT']))
            fatal_error($txt['smflinks_nocatselected'], false);
       
        // Set the page title
        $context['page_title'] = $mbname . $txt['smflinks_title'] . ' - ' . $row['title'];

        GetParentLink($cat);

        $smcFunc['db_free_result']($dbresult);
       
        $dbresult = $smcFunc['db_query']('', '
            SELECT ID_CAT, title, description, art_id
            FROM {db_prefix}links_cat
            WHERE ID_CAT = {int:this_cat}
            LIMIT 1',
            array(
                'this_cat' => $cat
            )
        );
        $row = $smcFunc['db_fetch_assoc']($dbresult);
        $context['linkscatrow'] = $row;
        $smcFunc['db_free_result']($dbresult);

I have edited It To

GetCatPermission($cat, 'view');

$dbresult = $smcFunc['db_query']('', '
SELECT ID_CAT, title, description, art_id
FROM {db_prefix}links_cat
WHERE ID_CAT = {int:this_cat}
LIMIT 1',
array(
'this_cat' => $cat
)
);
$row = $smcFunc['db_fetch_assoc']($dbresult);

if (empty($row['ID_CAT']))
fatal_error($txt['smflinks_nocatselected'], false);

$context['linkscatrow'] = $row;
$smcFunc['db_free_result']($dbresult);

// Set the page title
$context['page_title'] = $mbname . $txt['smflinks_title'] . ' - ' . $row['title'];

GetParentLink($cat);

Tested this on my test forum and seems to work as before please let me know if I missed something.

All The Best mick

mickjav

Quote from: Oldiesmann on June 01, 2022, 10:56:33 PMFound another issue. Trying to sort links doesn't work - you click on a column and links are still shown in the same order (date added) regardless of which column you click on.

I couldn't find a solution to this error, so decided to do a redesign of that section adding a search which I think is better for me as I have nearly 1500 links

https://www.databasedreams.co.uk/charts/index.php?action=links;cat=4


Anybody interest in code post reply Also have to give credit to @Diego Andrés for showing me how to do it with my gallery Mod.

mickjav

To clarify, the code was @Diego Andrés I just copied it and set it, so it would work with links, so prob need Diego's OK before posting code as he wrote the code I used??

Mick

Diego Andrés

Yes I'm fine with it  :D

SMF Tricks - Free & Premium Responsive Themes for SMF.

mickjav

#1195
I will post more updates over the next few days

First:

These edits allow you to add a post to a user's post count, plus sends all admins a message when a new link is added that requires approval (Note I copied The Below function from @vbgamer45 Gallery mod)

Code (Add founction at end of file links2.php) Select
function LinksEmailAdmins($subject, $body, $additional_recipients = array())
{
global $smcFunc, $sourcedir;

    // Fix subject line/body
    $body = str_replace("'","'",$body);
    $subject = str_replace("'","'",$subject);

    // We certainly want this.
require_once($sourcedir . '/Subs-Post.php');

// Load all groups which are effectively admins.
$request = $smcFunc['db_query']('', '
SELECT id_group
FROM {db_prefix}permissions
WHERE permission = {string:admin}
AND add_deny = {int:add_deny}
AND id_group != {int:id_group}',
array(
'add_deny' => 1,
'id_group' => 0,
'admin' => 'smfgallery_manage',
)
);
$groups = array(1);
while ($row = $smcFunc['db_fetch_assoc']($request))
$groups[] = $row['id_group'];
$smcFunc['db_free_result']($request);

$request = $smcFunc['db_query']('', '
SELECT id_member, member_name, real_name, lngfile, email_address
FROM {db_prefix}members
WHERE (id_group IN ({array_int:group_list}) OR FIND_IN_SET({raw:group_array_implode}, additional_groups) != 0)
ORDER BY lngfile',
array(
'group_list' => $groups,
'group_array_implode' => implode(', additional_groups) != 0 OR FIND_IN_SET(', $groups),
)
);
$emails_sent = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// Stick their particulars in the replacement data.

// Then send the actual email.
sendmail($row['email_address'], $subject, $body, null, 'errors', false, 1);

// Track who we emailed so we don't do it twice.
$emails_sent[] = $row['email_address'];
}
$smcFunc['db_free_result']($request);

// Any additional users we must email this to?
if (!empty($additional_recipients))
foreach ($additional_recipients as $recipient)
{
if (in_array($recipient['email'], $emails_sent))
continue;

// Send off the email.
sendmail($recipient['email'], $subject, $body, null, 'errors', false, 1);
}
}

Code (Add at end of links.english.php) Select
//Email Admin
$txt['Music_links_new_link'] = 'New Link needs approval';
$txt['Music_links_new_link_added'] = 'A new link has been added and needs approval. To review new link visit %url';

Code (Replace code in links2.php) Select
// Redirect back to category
if ($approved)
redirectexit('action=links;cat=' . $catid);
else
fatal_error($txt['smflinks_linkneedsapproval'], false);

Code ( Replace above with) Select
//Edit link below for your Forum
$AdminLnk = 'My Forum URL';
$body = $txt['Music_links_new_link_added'];
    $body = str_replace("%url", $AdminLnk . '/admin/?area=links;sa=alist',$body);

//Add To their post count
if ($user_info['id'] != 0)
{
require_once($sourcedir . '/Post.php');
     updateMemberData($user_info['id'], array('posts' => '+'));
}

// Redirect back to category
if ($approved){
redirectexit('action=links;cat=' . $catid);

}else{
LinksEmailAdmins($txt['Music_links_new_link'],$body);
fatal_error($txt['smflinks_linkneedsapproval'], false);
}

mickjav

This edit Sends The member who added a link a pm on approval of the link.

Code (find in links2.php function Approve()) Select
redirectexit('action=admin;area=links;sa=alist');

Code (Add Above) Select
Automated_Approval_PM($id);

Add function to bottom of links2.php "Note I haven't added any language strings"
Credit: @Doug Heffernan code edited from showcase mod

function Automated_Approval_PM($id)
{
global $smcFunc, $modSettings, $sourcedir, $user_profile, $txt;

require_once($sourcedir . '/Subs-Post.php');

$mem_id = 1; //Update for your ID

$results = $smcFunc['db_query']('', '
SELECT ID_MEMBER, title
FROM {db_prefix}links
WHERE ID_LINK = {int:id}
LIMIT 1',
array(
'id' => $id,
)
);

list ($owner, $title ) = $smcFunc['db_fetch_row']($results);
$smcFunc['db_free_result']($results);

    $pm_sender = $mem_id;
    loadMemberData($pm_sender, false, 'normal');

        $pm_subject = 'Link Approval';
$pm_body = 'The link you added for ' . $title . ' has been approved.';

    $pm_to = array(
'to' => array($owner),
'bcc' => array(),
    );
   
        $pm_from = array(
'id' => $mem_id,
'name' => (isset($user_profile[$pm_sender]['real_name'])),
'username' => (isset($user_profile[$pm_sender]['member_name'])),
    );

sendpm($pm_to, $pm_subject, $pm_body, false, $pm_from);
}

mickjav

Finally, found what was causing the main category page to push my right column down below the left column

Code ("Around Line 207 of links.template Find") Select
    echo '</div></div>';
Code ("Replace with") Select
    echo '</div>';

peter_mein

Hello
I find many errors in the admin center.
The error is No link selected.
See attachment.

SMS 2.1.3
Mod:4.0.1


vbgamer45

Update
4.1
!Fully hook for SMF 2.1.x
!Fixed bug with sorting inside categories
!Fix logging of errors for links that no longer exist.


@Oldiesmann  @peter_mein
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: