solved rotates phrases ,, good idea... :)

boplive
@boplive
10 years ago
345 posts
{* An auto footer that rotates phrases to help jamroom.net. If you like jamroom, leave this here. We'd appreciate it. Thanks. *}

Anyway this feature can be available to us..I can put something like this to good use.

Ed
updated by @boplive: 12/01/14 12:40:31PM
paul
@paul
10 years ago
4,330 posts
This is done by the smarty_function_jrCore_powered_by function in /modules/jrCore/lib/smarty.php, about line 2879.
Its setup just for JR but if you adapted this function to your own 'catch phrases' and links, then included it as a function in the include.php file of a custom module, as 'smarty_function_myModule_powered_by', say, that would do it.
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
boplive
@boplive
10 years ago
345 posts
I'm going to take a shot at it tonight..appreciate you pointing me in the right direction...will let you know soon the outcome. ;)
paul
@paul
10 years ago
4,330 posts
Good on ya ;-)
The module would just be the include.php file with its meta function, an empty init function (just "return true;") and the smarty function.


--
Paul Asher - JR Developer and System Import Specialist
boplive
@boplive
10 years ago
345 posts
I'm getting the following below trying to create the module????????

The developer prefix does not match what is in your Jamroom account!
Make sure you are using the developer prefix from your Jamroom profile settings.
updated by @boplive: 10/27/14 03:20:11PM
michael
@michael
10 years ago
7,744 posts
Where are you seeing that? make sure you change any jrXxxxxxx to a 2 letter prefix that is unique to you.

So stuff you make will be blXxxxxxxx or whatever you choose. I think the ones that are gone are:

* jr //the jamroom network
* uj //ultrajam, stevex
* n8 //nate flex
....
boplive
@boplive
10 years ago
345 posts
I'm getting that in developers tools / global config..
I tried the following 2 letter prefix
oy
er
And still getting that error..
Wht will be developers name in jamroom...
Will that be boplive????
Or is there something else I'm missing
michael
@michael
10 years ago
7,744 posts
Why are you in the developers tools? are you trying to export the module to get it ready to upload it to the marketplace?

--edit--
If you've built a mould and now want to put it into the markeplace, then we first have to get your profile here on jamroom.net changed over to a developers one so you can upload the module.

Once your changed over to that profile, there will be a new Developer Prefix field on your profile settings page. It will read:
Quote: Your Developer Prefix is used for all Modules and Skins you develop. Any module or skin you develop will use your Developer Prefix in the directory name to ensure they are unique.

Note: This should be a short, 2-3 letter long prefix.

Once this value is set it cannot be changed. Contact Support if you need this value changed.

But you don't need this to build a module, just to put it in the marketplace.

While you are building it just choose your prefix and build the module. You don't need to register it until the module is ready to be uploaded.
updated by @michael: 10/28/14 07:56:32PM
alt=
Centaur
@centaur
10 years ago
4 posts
Interesting..!!
Need to try this out..
boplive
@boplive
10 years ago
345 posts
Ahhh..ok..got it...
Is there still a blank module template..i remember there was one as I know tht will help me start to build the module
paul
@paul
10 years ago
4,330 posts
Just create a /modules/blRotate/include.php file and put this in it -
<?php
/// make sure we are not being called directly
defined('APP_DIR') or exit();

function blRotate_meta(){
    $_tmp = array(
        'name'        => 'Rotate Phrases',
        'url'         => 'rotate',
        'version'     => '0.0.1',
        'developer'   => 'BopLive' . strftime('%Y'),
        'description' => 'Prives a smarty function to rotate promotional phrases',
        'category'    => 'site',
        'license'     => 'mpl',
        'activate'    => true
    );
    return $_tmp;
}

function blRotate_init(){
    return true;
}

function smarty_function_blRotate_rotate_phrases($params, &$smarty)
{ global $_conf; $key = 'footer_powered_by'; if ($footer = jrCore_is_cached('blRotate', $key)) { return $footer; } $_options = array( 'Phrase 1', 'Phrase 2', 'Phrase 3', 'Phrase 4', 'etc.', 'etc.', 'etc.' ); $k = array_rand($_options); $option = $_options[$k]; $footer = '<span style="font-size:9px;"><a href="' . $_conf['jrCore_base_url'] . '">' . $option . '</a></span>'; jrCore_add_to_cache('jrCore', $key, $footer); return $footer; }
Then put {blRotate_rotate_phrases} in the template where you want it to show.
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
boplive
@boplive
10 years ago
345 posts
Wowwww..This is awesome..
Paul ...I greatly appreciate that you put this together for me...gonna try it out tonight. .;)
Thank you, Gracias, Salamat Po,big hug..High five... ;)
updated by @boplive: 10/29/14 05:40:36PM
paul
@paul
10 years ago
4,330 posts
Hold on - Wait to see if it works first. I've not actually tried the above code ;-)


--
Paul Asher - JR Developer and System Import Specialist
boplive
@boplive
10 years ago
345 posts
Success :)

It looks like its working...I didnt add anything yet...i'm just refreshing the pages here and there and trying different browser and its displaying...

now i'm just curious about something else...as there are differnet phrases..can there be differnt links instead of just one link below always going to one page..I would love to spread out where the phrases jumps to

$footer = '' . $option . '';


to relate to each options array below

$_options = array(
'Phrase 1',
'Phrase 2',
'Phrase 3',
'Phrase 4',
'etc.',
'etc.',
'etc.'
);
updated by @boplive: 10/29/14 05:49:17PM
paul
@paul
10 years ago
4,330 posts
Try this -
function smarty_function_blRotate_rotate_phrases($params, &$smarty)
{ global $_conf; $key = 'footer_powered_by'; if ($footer = jrCore_is_cached('blRotate', $key)) { return $footer; } $_options = array( 'Phrase 1', 'Phrase 2', 'Phrase 3', 'Phrase 4', 'etc.', 'etc.', 'etc.' ); $_links = array( ‘http://link_to_Phrase1.com', 'http://link_to_Phrase2.com', 'http://link_to_Phrase3.com', 'http://link_to_Phrase4.com', 'etc.', 'etc.', 'etc.' ); $k = array_rand($_options); $option = $_options[$k]; $link = $_links[$k]; $footer = '<span style="font-size:9px;"><a href="' . $link . '">' . $option . '</a></span>'; jrCore_add_to_cache('jrCore', $key, $footer); return $footer; }



--
Paul Asher - JR Developer and System Import Specialist
boplive
@boplive
10 years ago
345 posts
Hi Paul...im getting a 500 internal error with that code above :(

i removed this part and the site is back up
$_links = array(
‘http://link_to_Phrase1.com',
'http://link_to_Phrase2.com',
'http://link_to_Phrase3.com',
'http://link_to_Phrase4.com',
'etc.',
'etc.',
'etc.'
);

i tried with only this still getting 500 error
$footer = '' . $option . '';

jrCore_add_to_cache('jrCore', $key, $footer);
return $footer;
}

updated by @boplive: 10/30/14 06:56:57PM
paul
@paul
10 years ago
4,330 posts
Looks like at the start of the first link there is a 'back tick' instead of a single quote.
Sorry about that - my text editor does that sometimes!!


--
Paul Asher - JR Developer and System Import Specialist
boplive
@boplive
10 years ago
345 posts
the simple things in life...:)
like you mentioned... that was the problem.
Your awesome Paul

Tags