|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////# L$ z) d5 |5 _' g
// Theme Option
6 `5 W4 {5 Y4 t/ @% ^////////////////////////////////////////////////////////////////////////////////
' M& g/ A2 I6 b0 V8 f2 T# ?1 J# y0 I, S( G7 B7 B
$themename = "Zenx";
2 h. p/ ^ N/ d. g$shortname = str_replace(' ', '_', strtolower($themename));
% O- l& H6 y) }9 t. z' Y% a. O: j% H8 c
function get_theme_option($option). \, a5 Q. `# k2 Z: r
{1 I( m' x4 @- ^8 f0 M/ z
global $shortname;
/ i" C! ~% M, M0 ^; ~- d7 \$ M return stripslashes(get_option($shortname . '_' . $option)); f4 g$ i! C. S, u
}
8 w+ B, G! ?8 ^& L( q0 O! r
6 Y. \; P# ]- o6 P( ?' `4 u% a$ O$ Jfunction get_theme_settings($option)
$ g; P4 s) b# g/ Q; O% _8 D b) Z{
0 o p B8 Q- U6 H return stripslashes(get_option($option));. i" d0 C: L! B7 f
}
7 y/ L7 q% G3 e8 g- l$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
, d/ g, f: J; q" J. n5 V+ x% l$wp_getcat = array();3 Y6 q) g( a; {6 ~( {0 y
foreach ($wp_dropdown_rd_admin as $category_list) {1 Q& {9 ?( Y7 w$ Z& ~
$wp_getcat[$category_list->term_id] = $category_list->name;
$ P) @9 e r& |% B- ~ B$ S2 J1 ?}
. u W n/ A& P( z+ x0 D5 b# R$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");) U8 w0 [* J% Z/ F/ x9 E" D* Q
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
* m. e5 ^0 ?# G/ e1 z6 P7 b: a$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
3 ?# _* J2 H. F5 e
. x5 D% ^3 ~3 l9 J! d6 D, |1 J5 }$options = array (
# D% `& d: x9 P9 }& K" h6 n8 H' V, B# }! ~4 h6 M
0 |) l7 S: X& y+ F array( "name" => "Blog Header Settings",/ F8 x. f1 W2 K7 v6 w
"type" => "heading",; D. g; J- A5 W3 f4 s: q/ e
),
2 X$ r' y1 v4 n. i% C
# j) y$ S/ A) H array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 O$ G0 x3 |9 ?: {5 v "id" => $shortname."_header_logo_activate",
( K s0 K' Q% Y$ R# B "type" => "select",
% ]; d/ B) [8 f2 y8 n) `+ K "std" => "No",
* ]' l- [- @8 C* a9 [: w1 u "options" => array("No", "Yes")),
/ Y2 c# Y: p% n+ w1 H% b1 F% Y! W' A8 j; ?* @2 O
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
, u% a$ T/ L. f" S: r& `" a; r( t/ M9 A( Q "id" => $shortname."_logo_url",# D/ ~& Y' a. h4 X+ w1 g' I Q
"type" => "text",
" O p' ?* ]3 v: |/ q- n2 U* g. ? "box" => "social",
) K) D$ A9 o* m* P- u- L6 \ "std" => "",( P$ Z+ V: U: m8 \2 A {
),
+ y2 F0 G3 \' O" v5 e8 Q
$ T$ c: R. h' o array( "name" => "Insert Header Banner HTML Code (Header)/ k) \! m/ l" M5 s! [
<br /><em>*Recommended Size 468 x 60</em>
2 ]2 r- V6 u/ |1 w <br /><em>*leave blank if not use</em>",
9 @3 @7 `! x+ ?+ l M* ]4 c "id" => $shortname."_header_banner",
# G7 e! j8 z; z "type" => "textarea",
1 }% R' B" ^+ H0 H @ "std" => "",* j% }' L( w- }
), J& A1 k2 t! s7 j
" k* P0 N7 _2 t/ h: ]+ a
array( "name" => "</div></div>",
3 k. o" i" ]0 E: i# d- b "type" => "close",+ H' ~, k9 q* p/ Z4 b9 K! h7 M4 V4 e
),
$ u2 g: c) W; ?9 E s' R. ^2 ?# \6 H4 i
3 U. _8 n6 u6 V T- z0 _
array( "name" => "Header Navigation Settings",
% C4 V) E, j4 _" S. N' k0 ?6 n "type" => "heading", r2 M1 ?+ G2 H G2 r, `6 T! X
),
2 y, U. m1 i3 \8 o8 O' f0 A
5 `; U1 m& X: N7 M0 q( r/ T3 h* Z array( "name" => "Insert Page ID To Exclude On Header Navigation<br />4 }# T( k# E7 F
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
3 Z# A0 {4 ?' j! I$ K <em>*Enter the page post ID number only</em><br />; I( W. u+ U4 r' {2 H
<em>*separate by comma</em><br />0 H" l# ?+ j: E8 K
<em>*Exclude pages which you don't want to show on the header navigation</em>",
+ T. l* _7 |" Z4 f P# d "id" => $shortname."_header_page_navigation",
) J5 |; K1 F: d2 c: C$ t( |+ e: x "type" => "text",! B% M: `; }2 n
"std" => "",' B( h% h2 S* X7 ]; {4 g- A% |( {
),- y: d" _( q9 r$ _
4 @5 ^+ W+ k8 J! M( u" j8 F array( "name" => "</div></div>",5 O+ H: w1 j6 k; U* Z% B
"type" => "close",
( Y* B! F5 ?) W6 w- M( M: _, \7 F ),
" b' k3 Z" e: M2 m ' a" Y% e; P' z- H; A2 g) G
3 S: O' Y; e7 ^; ?, q$ i
array( "name" => "Post Auto Thumbnails Settings",
! f$ `: `* ^& s6 | u "type" => "heading",- J+ B/ @2 @( ]+ J/ R/ M, X, M# D
),
. Z" L0 r- ` j) l* A/ `3 i" h p( t2 y" l$ N6 S# X% F
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! n/ R$ `' l- d8 Z3 B; O "id" => $shortname."_timthumb_activate",
4 B+ p. W& j( `7 ^ "type" => "select",1 P8 c" ~3 ]1 k1 k
"std" => "No",& ?1 X6 P" i: K/ U3 C4 N
"options" => array("No", "Yes")),! {* J( X+ L2 u6 w+ h0 e
. e+ i1 L' V* [* [
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
; t$ D X Z! i* G: `$ ~8 w7 p" P "id" => $shortname."_timthumb_cropping",$ r9 z& H8 |; M8 Y V+ K
"type" => "select",
/ f( O6 Y$ h$ w% l "std" => "",0 s: B4 U( d4 @) @5 U
"options" => $crop_position),
0 u+ u- R. v+ D, e! t; }* O2 ^1 L4 d; ^6 w! a) n$ p$ z: S4 ?( W
array( "name" => "Insert Width Of Thumbnail Image<br />5 `$ a) h2 @6 O U6 Z
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /> i4 ~# |& f9 h: a6 f0 R0 N! R
<em>*Leave Blank To Use Default: 250</em><br />",
# F8 G) ]) S4 k J2 P6 h, N' O5 V "id" => $shortname."_thumb_width",, k! j8 J, E$ @7 D. [
"type" => "text",
0 ?- t2 a7 @: s& Q/ D "std" => "",
4 z9 _0 o9 x5 a7 X1 j. [ ),
. j. ~! B' b) b
; E) Z% P4 u: y! \. ?- O array( "name" => "Insert Height Of Thumbnail Image<br />
9 J+ _- M* H% v6 [. j$ G7 Z <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />5 [/ N/ H# N5 d2 |) y w
<em>*Leave Blank To Use Default: 200</em><br />",
3 u- t% T& j2 x "id" => $shortname."_thumb_height",
7 H5 W D8 G1 T/ Z6 v "type" => "text",: H6 T* s- n/ P3 G7 ]& k
"std" => "",
( ]! b9 }* l% m; ~ ),3 q5 D- f9 F8 N/ K+ a' X& q! d' P
) h" C4 W' J g2 @
array( "name" => "</div></div>",# q6 n9 k8 m' Q
"type" => "close",
" ~& _0 A# D M, \' V) F" f, t ),
3 Q' k* B$ i( u( b) x1 b$ O0 Z2 a
array( "name" => "Featured Content Slider Settings",
2 y1 R7 b h) f& E) o7 D2 d "type" => "heading",, p; p: {" j* ?+ ?! {6 M
),( n7 n$ G) i( E3 J& ]3 v0 G
2 z- `) u* p E
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) L5 E0 I& b3 x% L; _ "id" => $shortname."_featured_activate",0 ]* C& P/ a0 V7 H2 q* B i J9 u5 G
"type" => "select",
$ d g1 z' w' e/ Q+ ?$ C3 j) i6 } "std" => "No",9 y$ F+ b6 e! O N( I8 \
"options" => array("No", "Yes")),
1 ?& z$ X4 X/ s% N6 X$ d% ?4 n, a @; G. g# l5 Q9 [. Q1 V
2 A# D- n8 m7 M6 i
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",8 `4 t/ ~8 N' q& u$ u' `0 A
"id" => $shortname."_featured_category",
1 c6 K' A N7 h7 D: I "type" => "select",
( y; u# K2 n! b, I4 N% U "std" => "Choose a category:",! M2 y& P! a% P+ r) j5 S
"options" => $wp_getcat),+ [* n& X# a& S6 v
/ t: k+ N% Q1 c3 Z5 {
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
, ~4 U) o; I0 f "id" => $shortname."_featured_number",
& Q' L5 w$ e+ E6 K4 y "type" => "select",
1 D; P6 y1 ]3 j3 z: e$ R "std" => "Number of post:",
2 M, N: x& X5 D# v1 V "options" => $number_entries),
M0 z2 S5 d% U+ n
9 J& d1 `0 x9 j. b array( "name" => "</div></div>",2 L* _, z. s ~% A" z; ^
"type" => "close"," q, n7 ^2 g j7 i5 ~9 V
),
% t+ R6 N4 D+ E3 N& ^+ S % f9 \3 N: T1 H- a9 `2 C1 m
array( "name" => "Featured Category Settings",
h5 j: Z0 k+ p2 [7 H "type" => "heading",
: O( q6 U% D, y' y) N8 D ),- O5 Z$ [& V/ F3 S. l3 L$ J P
' v3 y+ f9 [& q3 o4 ? array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 R. f x6 S1 ]2 T( q+ V "id" => $shortname."_featured_category_activate"," U% }3 v I1 J* r ]" @( y- x4 a
"type" => "select",
- E/ B4 Y% e! z# @# N& a7 i% q+ g9 p "std" => "No",$ [. T0 P; @# j, E. F
"options" => array("No", "Yes")),
: G3 x- {4 u* I7 w
) `+ J; ?% N" `2 c0 a array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
! J/ H N! L* d4 O% [; D' X @' a "id" => $shortname."_featured_category_id1",: } Q5 N* E, D, S& F% M
"type" => "select",; r) {" s% A% c
"std" => "Choose a category:",& g3 _1 q8 a2 M
"options" => $wp_getcat),; W. U( _4 t( {3 c6 ]7 l
1 |+ w) p* P. I3 x& b9 ^4 [+ K2 U array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
, E* y$ D; V5 G7 d0 p0 H "id" => $shortname."_featured_number1",+ K4 h4 ~& E Q( R. D
"type" => "select",
) }% D2 t5 u: y, {- q "std" => "Number of post:",; d' o# j$ L# S! P
"options" => $number_entries),! |4 F* o; e+ k2 q7 q6 J: G# Z4 Y7 O
1 I6 R+ c" K$ b1 H array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",/ y% l+ t1 x: @
"id" => $shortname."_featured_category_id2",
, U# K" E9 V+ ]& T2 |: u2 U "type" => "select",) `- N9 w' e# z" H! J7 [: V
"std" => "Choose a category:",
7 h; A8 ]" r, Z- P' _( ` "options" => $wp_getcat),
' c. F: E" C* w2 E
/ S6 J- y0 P; [) j array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",6 C8 A( g% d$ J/ l3 }- x7 J: E: O
"id" => $shortname."_featured_number2",! ^& H6 o' o% o; q7 V
"type" => "select",* P3 t4 x# X5 C, H
"std" => "Number of post:",
. O3 c1 @$ \$ q/ Q "options" => $number_entries),
" f0 x' B/ f( v& C
; ]: M6 u$ \8 M5 f$ O+ B/ N " f+ \9 m* Z: T3 A: t
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",0 U. D2 U% z/ f0 m( m8 _4 X
"id" => $shortname."_featured_category_id3",
' v% G- F* V3 S! |" s "type" => "select",
# H7 K( N4 c* V0 y) z7 s' D "std" => "Choose a category:",( j, A8 ]+ m/ @
"options" => $wp_getcat),+ [$ ~8 F/ @9 S" R$ R/ z/ J
% k+ q% ?; x# r, j
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",$ ]" E @' K0 m1 h/ E: n
"id" => $shortname."_featured_number3",
3 H" g- ~4 Y+ {$ {# B+ }3 v "type" => "select",
4 H# w% g2 V" y) N% [0 D "std" => "Number of post:",9 h: Z7 `2 }# X% G0 |
"options" => $number_entries),
0 l- H7 Q" O, O; }0 ? I0 F; p" B% Z5 i9 N/ i# u
f) n3 o+ e* w$ p7 K) q array( "name" => "</div></div>",+ H1 W" L9 U* F* C2 a: D5 c
"type" => "close",* O' ]1 y. q: {6 _% V1 {
),
1 T- F; G* P$ h: ^2 ~8 `' L- N
4 |2 R, t% c( s1 t/ ^( j2 {
2 H6 `6 t! ~ L2 r* m array( "name" => "Google Adsense & Analytics Settings",
- R& B3 ?4 N; ^/ d7 D "type" => "heading",& J/ M+ S/ P& i
),* x6 E% Y- j/ e" S8 n) c. G
* s, k; v+ _1 n
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",, [1 z1 Q! O K! p# g: W# I) L" t
"id" => $shortname."_adsense_loop_activate",
2 z/ S8 W2 P0 @5 K "type" => "select",
: A/ _8 d6 i" t) H3 r "std" => "Disable",
: T1 q! O& y$ v/ } "options" => array("Disable", "Enable")),
1 e- X1 w, g) w9 X7 i$ P! M5 D
1 x& }% B3 f5 T7 r- ~/ I. \ array( "name" => "Insert Google Adsense Code For Loops Here<br />* S$ ?6 M/ Y. ^+ K7 l7 |
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",( S& W! i: R7 Z
"id" => $shortname."_adsense_loop",' [" ]- H8 A K7 N; b5 U/ T
"type" => "textarea",
* [8 H$ p7 q. Y; e* x# B "std" => "",; T. b( Q( |8 d: M, G- e& v. t
),; d+ X# {8 l% m6 {+ l
: `9 M2 D$ u- r; ~/ { array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
3 C- l$ l) g7 y; G "id" => $shortname."_adsense_single_activate",& ^( {6 a7 d" v5 y% u: g
"type" => "select"," j9 [! M# {" N( T- D
"std" => "Disable",& a- c0 o! c( E3 `+ s" Z/ x
"options" => array("Disable", "Enable")),# p4 p$ N; d0 C% X# M( v' L5 @8 x
( Q1 Y1 K' W% A0 H3 R# J0 F1 Q
array( "name" => "Insert Google Adsense Code For Single Page Here<br />7 |8 J6 q/ E! J" J( V1 B
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",& s# n% x- @, K; y
"id" => $shortname."_adsense_single",
) d" T- I/ w1 V/ o) x% C7 R8 l "type" => "textarea",
7 N3 C6 C4 V* {( R "std" => "",2 g$ a' u. _! V+ h$ b0 |% Y
),$ B2 x% G. E" g7 T
% f! [$ A9 ` ]7 Y5 ?4 w7 G" X( P
# M: G- S2 V4 e9 u; [- M& K
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",$ f! \+ L1 p, v7 F/ X/ g n
"id" => $shortname."_google_analytics",+ b, f+ R+ @0 P# Q- S' k
"type" => "textarea",
; \+ l' l# W! ~* k0 M$ B "std" => "",
' a! k. H- G- t1 w1 R0 H ),
3 Y7 R" v+ @8 ~$ O
% H9 ?# x( L9 o* l* V array( "name" => "</div></div>",
$ h& f# C* M" |1 s "type" => "close",
' b* l1 \! |; W& i2 } ),
# D7 d% d5 a1 G9 X( R
$ f, B- U, [# T( L! s$ t
) U" `1 c- h; t* A$ e$ p! b; k+ W array( "name" => "AddThis Social Bookmarking Settings",
/ e3 w, y* g" V5 L1 d. d "type" => "heading", T8 H/ P5 [% S1 ?% S8 i, w
),8 R2 s% Q. N. m) I: j9 a% k
d1 C$ S; p# q( O! d2 i* @
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>7 `) ~. {: B, r1 Z! x2 i
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",' { ^; ]# w' \8 N
"id" => $shortname."_addthis",* C) J n. I: D+ E& H
"type" => "text",( ?( Q# e2 `6 ^+ k
"box" => "social",
! y9 s7 }9 L9 @ "std" => "",0 u' ]/ p' e5 O& Q1 q
),) z2 ]6 K: C" L4 J. J( p
$ Q6 q O9 n- T7 }& n
array( "name" => "</div></div>",0 E+ M* F8 n% u! R( _
"type" => "close",: {, j3 S/ @0 K7 ^9 l: e1 k
),/ @ F ~5 W% }( H
2 d' W# N. w9 W
7 ^) F9 Y. }& F6 m/ z% b
3 @1 C, C4 X. H) p C- j6 V array( "name" => "YouTube Video Settings",7 ~- C2 y" Y9 F& t- X0 L9 m
"type" => "heading",% p7 E, x. [( L8 f/ N; h
),
7 P5 U F- k D+ U1 |5 l; @% `# ~9 L
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
' i. e b8 q. P+ ^8 f6 M0 C "id" => $shortname."_emvideo_activate",4 k5 v0 a# F+ l& u5 U+ \# M( [7 _
"type" => "select",1 e+ j; L# z4 t2 m
"std" => "No",- B& m- g& D3 }0 |3 X
"options" => array("No", "Yes")),
$ N9 u0 E2 e' ~" e9 f6 @1 E1 g; c/ J! V: y
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",7 R0 X# k, U+ e w8 j
"id" => $shortname."_emvideo",
- }; U% H t$ t( x& w. ]2 K' o "std" => "",1 @6 w; i8 u$ l. n6 _
"type" => "text"),! J. l% W1 a6 S, c8 J% p! h
- d( h: {3 Q& ]7 }9 }0 C9 i% u array( "name" => "</div></div>",
" q( e Q3 t. j3 O$ r0 I) Y "type" => "close",: a- H1 ~; W/ K) i$ N! t: i8 [
),
. d- a6 B, k" Q; z+ k ; B) A }1 H5 @1 \9 Q
array( "name" => "Twitter Settings",
# s ?) ?9 i6 A1 ^* ~6 R "type" => "heading",
6 |) @* M# j( S7 d' x ),
8 {8 L4 T9 k+ j" }3 K' F* C7 [6 }4 W' W/ _
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
( G4 P8 N! [- X* \2 A- E. y1 O7 e3 p "id" => $shortname."_twitter_activate"," {/ a1 L. w o( Q" `) P7 Y
"type" => "select",
; S i# x1 ?8 b7 @. p "std" => "No",7 _2 A' z0 W8 I1 ~" p3 o1 q
"options" => array("No", "Yes")),
" \, T/ B- g3 a. A* ?4 X0 n1 \
- O( N( E- g; |) E7 Q array( "name" => "Insert Your Twitter ID here! {6 i, n' S! k* o; q
<br /><em>*leave blank if not necessary</em>5 C. g; B4 l- W% F" }6 @/ D
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",; D) t( S% @) n. [# D+ ]8 M c
"id" => $shortname."_twitter",0 B" b. N& a4 c. Q% X: O* o
"type" => "text",% Z' l* T, ~) {6 z: ]& ?$ e- s
"box" => "social",( G8 [6 @7 }; g% {! @$ @3 e
"std" => "",$ w# P$ z' e \ q6 L
),0 I- k F; W$ Q/ I# o
! v) y& d7 n% l6 L0 i- k
array( "name" => "Enter Twitter Feed Count here5 n4 _* N, G1 c5 X4 A; r# u: P
<br /><em>*leave blank if not necessary</em>
, G. P' A, }$ j, m B0 R% h <br /><em>*Enter How Many Twitter Feed To Display</em>",1 u! a( @6 F& E2 @9 ^% I' u
"id" => $shortname."_twitter_count",
4 C8 V1 Y K5 u% f. f/ v7 l "type" => "text",5 }. ^6 n# N0 T! q6 H; [$ w
"box" => "social",6 T* L4 V: m/ d* X
"std" => "",
1 O4 C. F$ A2 g6 D, `4 \/ _ ),/ F. O+ g+ T9 \) o( R
* g4 B& ]' U1 Q% K6 W
array( "name" => "</div></div>",
$ R& N+ e6 D8 s' X "type" => "close",
2 z. n. b8 H3 _. f$ j5 X ),: K# C5 D& I! O5 V& L6 E- A3 R5 K
7 P9 u' Z- E8 z* F6 n; x' e9 a
+ ^( [( @/ Y9 e8 v) T2 K4 v9 F7 [ array( "name" => "125 x 125 Banners Advertisement Settings",
& ~: k, p2 Y/ ?) \ "type" => "heading",
- j5 |9 t+ }9 x* S o9 [ ),
9 { G5 N/ M" |- F7 x' H% m, c3 b+ U
- k; D- z) ]0 N7 ] array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) S, T+ p3 q- w1 ^. \8 J4 N
"id" => $shortname."_sponsor_activate",
T8 U& y/ E R3 N "type" => "select",
: Y7 j* E) L) h7 B' }" y- q "std" => "No",- s8 E* s* R- h+ ~1 C
"options" => array("No", "Yes")),4 t" i3 Z5 s' H K d
1 n/ v W W- _8 W
5 l5 n4 T e' q2 G! A7 N/ M& {
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",9 z" `. Z* ~7 _1 A% F9 x" u* X
"id" => $shortname."_sponsor_banner_one",
; d' w7 J6 G8 r+ G+ Y) L "type" => "textarea",
# c& A V' K' k "std" => "",5 U. \# w |, s0 `# d: q5 z
),
6 i9 s2 j) @* z0 P3 S( p
6 M) v9 p+ P- p array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",3 a, V6 P0 j: }' i2 W
"id" => $shortname."_sponsor_banner_two",; d* H$ Q7 t) k" D8 q/ a ~
"type" => "textarea",- l. |1 o8 t" N/ J: z/ t
"std" => "",# p' Z. R9 N; C: ?4 E. x" N
),
, E1 b/ _ q7 E' J/ Z( }' w8 D2 F2 l) w; g' x. n: `+ I" ]
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
$ K, R: N* {4 W3 ^# E "id" => $shortname."_sponsor_banner_three",
' k7 v2 s% {- K( J "type" => "textarea",
" o' X2 k% j* y) e6 |1 @ "std" => "",
" D, O( M+ j* q, h+ k4 L: B8 P3 q/ Z ),
3 A; O7 w/ m) p# r5 L# z( t: V* D3 c3 H) k i$ g
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
1 f8 Q; q$ k$ Z% l& W "id" => $shortname."_sponsor_banner_four",
' n' r1 N' z' B& u% E "type" => "textarea",. f/ n4 S1 Z. p( O* q) M& c
"std" => "",
! g/ G5 P; G, G3 U8 O2 L; ^* R9 F ),- J+ W* a7 L) i$ J" \
3 N3 g/ j5 @1 v array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",# V" u/ b, H" {
"id" => $shortname."_sponsor_banner_five",4 L+ T( z. v5 u: c# e4 G% C H" X
"type" => "textarea",- y, ]5 J5 z7 i7 K! d" Y
"std" => "",
# g7 v4 R8 B0 b6 a5 R ),
- w" ?- v% H# a y3 v' X) u) O" R# K2 ]$ i- D
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
3 M0 S' P5 F- Y9 g% g4 G0 Z0 J "id" => $shortname."_sponsor_banner_six",
7 p3 @* M; J: f8 c6 {4 D9 A" C "type" => "textarea",
' Z# g! L: m/ t! H "std" => "",
. U, z4 n& h+ y2 g: U* W7 h8 T ),
5 |8 A- P1 o! p r3 w6 }* I3 e3 {* i0 ~ t0 c
array( "name" => "</div></div>",) d& l8 R" Q9 u( A( q
"type" => "close",
- B3 j w: b5 P1 M: I4 p" ` ),# Y) w3 J: b" x( A4 `/ @
& e% H$ R7 f- M$ R$ C: c8 |: k7 j" E6 R$ r3 E: z. m4 ?- a5 W
2 H" i) c. v5 y1 _8 U! u);! y7 Q9 Q% {: c) {/ t) P
1 f7 R1 V$ u$ U8 \
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {, ?, C5 r0 a0 F; m8 z
7 U) n8 B" U% U" C" h8 M0 uecho "<div id=\"admin-options\"> ";
) G4 l) b% s+ j
$ c$ u! x6 ^9 o _ h7 a- nglobal $themename, $shortname, $options;. j& W7 z: `9 }' A
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';$ C$ _' a! c2 b+ u; J
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';0 l, b# w6 G3 k; x1 n
?>
3 ?9 i$ `/ L7 h
* }" o! H6 X7 m. {# r1 J* n<h4><?php echo "$themename"; ?> Theme Options</h4>" _9 S/ H8 H' A0 P6 C
0 ]4 j) m2 Z" V9 f7 M0 L<div class="annouce">" m5 I# d4 [2 q
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>) f; M$ D7 a4 }0 R
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
' ~+ D1 H" i2 i, M</div>
+ a; }* k x! B6 g$ N( U' O8 u5 n* [' M
* ?3 ~7 T7 N- p6 T6 E( G<form action="" method="post">
+ P, b( X2 C- O9 E% D) ]. b( c% l- `9 G* `% C+ s: l' F6 h
<?php foreach ($options as $value) { ?>/ q$ n- T, Q9 a: {, x
" k6 n& D) `, y$ h2 k' P [$ ]<?php switch ( $value['type'] ) { case 'heading': ?>
8 w# N4 @ W8 R4 M+ J" t7 ]" k
) Y, l2 t: I. R! Z) A$ R<div class="get-option">( V+ r+ K( ]! Q7 c. u- ?: i
) a, R* W- ^6 ~' k<h2><?php echo $value['name']; ?></h2>6 }2 [; i$ X: u% K% F
) p! R1 \# ]9 d0 G$ v M" a<div class="option-save">
* L4 \( @2 D8 h" \8 l4 G+ H. E4 s: K0 B' q" {, m5 x+ [+ j
<?php
3 e! ^; R5 k3 \: c. Dbreak;
" @( o5 O# z. M, X8 j, Q$ Jcase 'text':
' P+ Z6 k* U# ^' `?>
( }6 X0 K/ O( f2 a4 j* X& T/ g) h+ _: t/ R1 C
<div class="description"><?php echo $value['name']; ?></div>
% e7 s- G: M3 C2 ?! x7 f, O/ C<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
7 m x, G# _! Q( H3 q: o. [" L3 k9 i+ I* }& @) f& i0 M3 J0 M9 Y
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>, L0 b' I# b; ]
4 a) T+ [5 V3 M" ?<?php
- |) Q+ \! U, @ Wbreak;
3 u1 y, w/ S- }0 t3 i: F' Rcase 'select':$ H, N3 ], k, U$ F
?>* i! z# w" h8 \! u
% i( T# d+ ~! r1 ?
<div class="description"><?php echo $value['name']; ?></div>
3 L9 m; k( W; ~( f3 Y$ K$ ^<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">- q5 K5 ^$ `, w6 C. b
<?php foreach ($value['options'] as $option) { ?>
+ {) G' x0 F; m" c4 W4 Q9 x<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>5 Z9 c2 m) R @
<?php } ?>
5 j* G' j! L! }1 G" M, A \</select>
6 H" e. b2 w. R. v</p>, U' H( v M3 k1 C+ g" F3 A
5 J( w! z X8 l! I+ M# x<?php
8 @) i7 h0 y( H4 N% _$ Hbreak;
, p! ~! _" a# [$ e8 @# [9 N4 h( {case 'textarea':' O& ^2 s! k4 d a, t) d/ p
$valuex = $value['id'];
4 ]0 p% T( S5 m$valuey = stripslashes($valuex);
6 V, `$ P5 E2 E, e: s$video_code = get_settings($valuey);$ {! k/ i& y A0 Y% f9 J' Y8 S
?>
7 y0 Q. p/ `' n' \5 b
( J( @* C$ e b7 K<div class="description"><?php echo $value['name']; ?></div>
, B: J4 Z/ l* f9 ~5 O& M: E( r<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }% a& a8 W- E& v' b' N4 T" @
9 g1 K: y' e$ r# D4 v4 T# b: T
else { echo $value['std']; } ?></textarea></p>* w5 X9 v* J1 H9 B) Z# e. a f" m
1 t$ O3 T2 D2 S1 B) c<?php; | S; K( M! n; ^2 U6 _
break;
& q2 r/ l% d5 ?0 Z3 \! hcase 'close':
2 u/ u. a- ]! A?>% L9 M! O; A% {
" L X4 A1 A, ?9 o d! x0 L1 p
<div class="clearfix"></div> W# T4 i5 R' ~1 ~: x7 ?
</div><!-- OPTION SAVE END -->
) x7 a3 [3 B5 k4 O+ Z
" N) O; R M. M2 c( Q. S# R9 B<div class="clearfix"></div>: s: n9 p4 a. F5 ?+ w
</div><!-- GET OPTION END -->! o4 i6 e( B3 n5 Z* A$ |
4 P0 U* r5 U! t& e& @4 @6 P3 Q% I) m<?php
9 v9 h4 B+ `6 @) k9 ^break;
A; z, ]; ^# _& hdefault;
/ ]& e" W. S: \$ E+ O?>) G% |9 O8 |0 c! S9 w
8 O1 S* T7 U `6 n: P9 D" S
8 B( ~; V6 [' ? x: h* v<?php8 z+ p3 I3 |4 z1 n1 z) _ m# O' u
break; } ?>
% {3 ~8 Z7 G! Y) l( }: d
( i& Z6 [( L/ v! V8 z<?php } ?>
8 ~: i% c/ n) o3 V, X9 s
3 [4 x& j; u. q$ `0 ]4 n* L4 }<p class="save-p">
8 c5 a7 v+ [, N. ^% E<input name="save" type="submit" class="sbutton" value="Save Options" />0 _+ ^2 @# u( u* G2 P. O# x. E
<input type="hidden" name="action" value="save" />: x) D/ o1 s0 Y: a
</p>
6 }+ H4 f( [5 f6 y$ H" p; j</form>
6 T: q4 j3 w, P8 o7 ?3 q4 [4 f* H- m( T+ ~8 I2 G
<form method="post">
( s- ~. _) T& ^, n4 |7 B<p class="save-p">
1 h4 e0 i8 L* r1 x# \<input name="reset" type="submit" class="sbutton" value="Reset Options" />4 N5 ^2 u0 `9 i5 ?
<input type="hidden" name="action" value="reset" />
# x3 S$ X& v! i' V. q" Y9 S9 q/ G$ X</p>3 b D: F/ Q0 g* J
</form>
; T9 }1 Z$ Z. }
9 ]7 G$ W2 H# t! o# ?+ h</div><!-- ADMIN OPTIONS END -->6 b$ w/ m- F; m. q2 N1 M
8 O) `* P2 s6 i- I( {4 H6 Q<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }0 q. G3 G! h5 D8 Y, R+ Y
1 G8 ~( y7 O/ f' L' I0 t% Xfunction mytheme_admin_register() {7 E2 r( x' i H! l7 U
global $themename, $shortname, $options;1 y @0 Y% @! b3 D
if ( $_GET['page'] == basename(__FILE__) ) {
, s2 l K0 q, y3 _' g* J @; V$ Vif ( 'save' == $_REQUEST['action'] ) {# G: Z3 I9 S2 U5 C* T$ \
foreach ($options as $value) {
* |) O# h5 C; i$ C4 S fupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }# L& g, c8 s9 b1 j3 ~1 @5 ~3 n6 F
foreach ($options as $value) {
; X4 ]% ^) y0 T d0 X7 D2 b E4 H9 Sif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }) _; d; z7 j* C' {
header("Location: themes.php?page=functions.php&saved=true");
- Y4 ?7 e& f& \8 ~; w4 rdie;
4 B# I. Y3 ]6 D5 M' L- X% b/ ^/ B) ~} else if( 'reset' == $_REQUEST['action'] ) {4 C2 n; ]' M6 ?9 t! ]1 p' D# t
foreach ($options as $value) {) w3 P2 N+ t- C7 Z9 I# }# J
delete_option( $value['id'] ); }
2 i- r; e' Z# U) Q5 d3 |* oheader("Location: themes.php?page=functions.php&reset=true");
. V, U' k. e5 Xdie;
- f7 [2 ~, v* H5 y/ I}& q% Q# Y [, v# z# t u5 |; T
}6 X: h+ J1 _. t+ w7 V: Y
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
# p% u& U$ f7 A; D R8 Q, Z}
& s3 }0 U. ^5 O6 n; P3 E; S1 J' T h1 M1 f0 _; i
function mytheme_admin_head() { ?>
; Y- }) i) D& ^$ C, X: x# _" t. w2 }<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />7 @3 y/ I* g! K, Z
<?php }2 I% q( x3 G/ v* k; f1 C/ X
|
|