|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////3 ^) R" |- a9 ^# I! h
// Theme Option
6 D/ e- i( R) s0 T. v# W8 y////////////////////////////////////////////////////////////////////////////////& Z) `* g; S; h
4 ^8 Z1 e' C6 z& U. A
$themename = "Zenx";
( g# v; U! m3 T8 R% `$ s$shortname = str_replace(' ', '_', strtolower($themename)); N+ e( r/ o8 [' w
/ L) ?2 c& _& O( X! O$ Mfunction get_theme_option($option)' D# Z; r) v1 a% j* ^8 A8 ^
{
& \& ~2 C3 K0 _9 D" o* C global $shortname;4 m& \8 \0 j i+ i8 k
return stripslashes(get_option($shortname . '_' . $option));; O" Z9 P8 Y! T
}7 Q! F# v" I9 F! Z( u
8 i4 p% n c8 @, M+ I
function get_theme_settings($option)
$ u- q/ d' @7 t D: y{
8 k+ ]; ^8 }( U! P return stripslashes(get_option($option));
7 Q9 {+ i1 q- k5 y4 H% K# f, B" U}! `8 j3 Z* }0 C- i7 D' |, t+ D! [
$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");0 o' n! ~# q" c0 V' v
$wp_getcat = array();3 A* ?1 r/ C" T+ R) S/ ^$ C
foreach ($wp_dropdown_rd_admin as $category_list) {
3 l4 p) y1 M$ g$ G* \( k$wp_getcat[$category_list->term_id] = $category_list->name;
; t& a6 m& [, H4 B, O I/ s8 |5 J}
) e2 r0 E# a+ b$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
1 v3 W( E- M7 o' u, ?/ D7 x$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
- e+ P0 D( n# P# _$ G' V' {: X9 y$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");9 [% b# J7 J4 P
/ B7 q4 ]) x( w$options = array (/ ]3 Q9 h4 e# c8 I+ ]/ Z5 ]' j
7 F3 w+ N( x0 h* M* R
( q; J3 g( A( S1 F% _. }. Q3 l array( "name" => "Blog Header Settings",
( H' s6 \# Q0 P. `% B "type" => "heading",
# B: M$ k$ ?4 v8 U9 v3 { ),
8 Y+ c: U% e& L i+ j% m9 T4 O; E7 H$ x7 X8 H( h* r& t' n- |) h
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 d: K9 v# y$ T: v) X' N "id" => $shortname."_header_logo_activate",
! F5 T( d, I* |- r, M$ W "type" => "select",0 ^7 d2 B* F/ W i% J" q2 E
"std" => "No",; ]2 B) N5 I; i" V% Z( n9 n
"options" => array("No", "Yes")),# y; X2 N9 W% q |/ F! e5 y
J; u6 l$ H9 J array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
) n$ ~9 x# x* N' Y "id" => $shortname."_logo_url",2 ] S+ q0 J1 @6 z# |
"type" => "text",
- K( P. q8 ~ K! g/ @8 a "box" => "social",
0 V8 w" Y! b9 k& L1 F7 S "std" => "",
7 }% w" s( _2 _* j1 ` ),
, Q4 @5 o4 |: i2 {: p. ]% u ' R4 l* {* V: e
array( "name" => "Insert Header Banner HTML Code (Header)! i1 D% o( j& v& I% q& Y h! w- ?
<br /><em>*Recommended Size 468 x 60</em>
8 j8 w! h$ M4 y <br /><em>*leave blank if not use</em>",+ ~- {7 M8 a" h" _* D+ l. r; N
"id" => $shortname."_header_banner",0 }- _9 p5 v3 U9 ~2 c- q, N( a! v; G( l
"type" => "textarea",
3 Z" A1 S* t. D$ x2 Y3 a4 u4 l "std" => "",; @1 ~. i3 J4 I4 c" D6 c. ]
),
. x, v! V- t- `$ T8 h0 y7 ]3 G
2 T% ?" |% c7 l8 Q2 {7 N @ array( "name" => "</div></div>",
- }6 }7 j& X" g, K "type" => "close",
E! B( r5 g, ^. P2 p( L4 G2 ?4 N ),0 ?8 ~, h& C) _) }7 _* e% a
' h- J$ r; z* q$ j3 e1 d! Z: [0 c
6 R* J: k, l" E# D% ]- _( Q array( "name" => "Header Navigation Settings",, E( b- I, c, S, p
"type" => "heading", \" @4 Q5 T$ D# L
),2 {0 o m, X+ Z& z( T4 N
/ y( f- P; J# U& q2 p array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
9 k! K/ \8 t; W! L( w% W <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
5 A q! N8 H1 q( p! o9 m/ L <em>*Enter the page post ID number only</em><br />
/ Z7 A% [8 L, ]7 K9 j <em>*separate by comma</em><br />* M' }% F5 |0 j" b* N9 f9 I
<em>*Exclude pages which you don't want to show on the header navigation</em>",
& n1 d0 z3 }# }/ ~! r' O1 ` "id" => $shortname."_header_page_navigation",
0 u$ p+ a- \9 U6 G0 f1 y; o "type" => "text",) W- O$ A8 D; f' F1 f$ t/ S
"std" => "",0 J* u- g L1 s7 k2 s- f9 a' U
),/ T) u7 H3 o1 z$ x9 n
0 n3 I8 Y# Z+ o- s% l array( "name" => "</div></div>",6 N0 c" P( Q) x" E1 t- ?
"type" => "close",) b" c, l+ n6 s
),
1 W+ i! x+ m+ K H, y
; P3 ?/ y- Z. w$ e) M- M2 `7 i; y4 w/ Y
array( "name" => "Post Auto Thumbnails Settings",
! Q; |' @& [8 H "type" => "heading",4 W* s$ [- Z: |/ j
),
2 P6 f2 m1 _1 O( d' C, S# A 6 B7 @6 x" G- L2 g; g4 y
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( }) E& U- C( Y \' @/ t
"id" => $shortname."_timthumb_activate",- @1 S& G( R+ Z0 g1 b, w. R& A% t
"type" => "select",
" m' W6 w. H) f' ]- T9 r "std" => "No",7 G5 ? P. i, v' z" o% N0 d
"options" => array("No", "Yes")),
' `7 p& A, z( V ( n, }. P# r; L3 O6 z1 H
array( "name" => "If Timthumb is enabled, Please choose its cropping method",8 |" T* n! J9 n9 q
"id" => $shortname."_timthumb_cropping",
7 b' G& X6 d# M3 e/ X1 Q "type" => "select",3 b- k: P4 Z- r8 q
"std" => "",
; v1 @. H$ G% {% V7 P7 m2 t "options" => $crop_position),
9 G% c) [# e" j/ l! e8 C2 I G) t/ G8 |# M- Z
array( "name" => "Insert Width Of Thumbnail Image<br />
; Q+ ]/ |8 ?3 K q <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />+ b. ?6 a/ w7 D$ g- s, n; \
<em>*Leave Blank To Use Default: 250</em><br />",
2 E; U; j' `) O* n! ^- \ "id" => $shortname."_thumb_width",- I! q$ W! K6 M- I0 A6 J
"type" => "text",
4 @+ G. j' z2 F$ s4 t r. W "std" => "",
, n% J; ?! {3 K5 m) [ ),0 _0 A8 X! \, r7 L* E) }1 l
/ I9 Y6 p% X/ M8 j( F( d, ^ array( "name" => "Insert Height Of Thumbnail Image<br />
: P& X4 y' `+ g7 ~$ h. X9 y3 u <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
! f6 L' `. T+ J5 q1 n9 d4 M <em>*Leave Blank To Use Default: 200</em><br />",* X4 K8 M7 g: ~1 g7 k
"id" => $shortname."_thumb_height",( L* s3 R! T' w V/ l
"type" => "text",1 f8 G5 T$ |: P& F2 x
"std" => "",& j! n8 P) g) M; `) h8 { N
),
8 H/ E; i5 w$ |4 p h S( u4 k4 J6 K. ^( [$ O
array( "name" => "</div></div>",
" t: M, B" p- }9 d" d5 } "type" => "close",
: Q; g* B& K3 e. l' X, N ),9 F# R3 z( F9 k! p
0 a& _6 A: V4 L: G2 E1 ?; J8 c array( "name" => "Featured Content Slider Settings", {1 J. ^* @' E3 ?
"type" => "heading",
4 w1 A- k* {% O. D) O6 Y$ M R ),
' d" S$ a( i. o3 M8 }5 s- A, ~, a, G" g
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 g& m: v; n/ {5 V) Y. `2 o, R "id" => $shortname."_featured_activate",9 x& C6 L* @" J9 P! [, |
"type" => "select",
0 a$ e+ c# _' K: v; B2 C "std" => "No",' a5 i: F) m4 M, F" B
"options" => array("No", "Yes")),
+ f% [+ z4 P/ C5 T
/ b" T# Z3 E& F$ H& {6 b2 F( o% Q( d0 J1 f( n
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
! ^8 C4 p+ v/ W8 |/ Q$ i "id" => $shortname."_featured_category",
4 x" F$ u" h: g, e7 s- y# s "type" => "select",' H0 ]' E( [- g3 W5 \ s! c
"std" => "Choose a category:",7 G' Q# a0 O0 A) H0 |! B
"options" => $wp_getcat),, }5 y2 E9 r7 k$ w) z- Z
; O* b- V5 V9 v+ N2 W w array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",2 W/ M0 B( D5 U
"id" => $shortname."_featured_number",5 [8 F# J% m4 A% y
"type" => "select",
( n4 ]# @$ o! H "std" => "Number of post:", M! ]4 l0 B. i! f
"options" => $number_entries),
7 W6 ]5 _4 ]1 R. v
' ]- }# L, @$ h7 L8 a' n* } array( "name" => "</div></div>",* P( T. f: v: F5 J" B* \+ ^
"type" => "close",
# M M C6 n( Z2 e$ @& i' k ),( E) p9 f o- k1 v# _2 ~
1 J; l+ l4 m% o& ~
array( "name" => "Featured Category Settings",8 ]& p! I- I3 K' g) w
"type" => "heading",0 d. e, Q& n# f5 b" R1 ]# l! p7 f% w S
),
! n: ?% @/ `/ P- l/ o4 M/ v; w8 q+ ^3 h( o
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. n' g- \$ @- ^8 a7 @! h `& e: e "id" => $shortname."_featured_category_activate",
: ~: W: I; q& a7 s" N0 F( R' ` "type" => "select",
9 k0 p$ N. s/ i7 V7 L "std" => "No",
) \, t; u/ W v6 D7 E "options" => array("No", "Yes")),3 c" v7 I/ Y+ F* G
: z9 J! O2 `* a ? array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
1 J% R z# b) p+ u2 S7 i6 \ "id" => $shortname."_featured_category_id1",
6 f3 W( z; N* ~% @ "type" => "select",
1 H, q# X6 u$ w7 r "std" => "Choose a category:",$ I& v% k1 f( n: O
"options" => $wp_getcat),* @2 _1 J9 [: \: R5 V
/ ]9 e, r& ~$ O5 f+ G9 j' ` array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
2 R4 G& W* e, @/ N% q9 o9 {0 ? "id" => $shortname."_featured_number1",7 l: E; x- q7 o. o7 F1 z
"type" => "select",& H% }3 J5 |) ]9 x
"std" => "Number of post:",
+ a) K* K' ^! _ "options" => $number_entries),! F2 J" S \9 ?; B$ \
G, _$ E, m9 i# K m- ], B
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",7 F6 @7 K& Z% n
"id" => $shortname."_featured_category_id2",2 ]; \" p5 l- K3 v5 _* {# j
"type" => "select",/ j$ g9 t k2 L4 r& g0 R4 C9 \
"std" => "Choose a category:",- @' a0 D) G: I9 g
"options" => $wp_getcat),( Z8 K$ X( `' s/ z0 K% E
$ v' x+ ?6 ]: W+ ^" [
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
4 ?% r- ` w' x/ v$ j4 S! g "id" => $shortname."_featured_number2",; i! [4 `0 S) U9 \" x7 [7 Q
"type" => "select",/ P+ }- O$ y+ J. p
"std" => "Number of post:",
) D$ p- e; ]% T2 ]! c "options" => $number_entries),
. L4 ?) w! y$ j8 Q
e: Z5 M& J3 C6 q( ]7 O' O5 W' @ ; E% I8 N4 f; ?' \/ v3 I) j$ K
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
$ l8 W& r; Y/ f6 A "id" => $shortname."_featured_category_id3",! D0 L# {5 `1 { G0 H. o( ]3 h
"type" => "select",
0 h" }' ~( a4 i1 d" ^. L% D/ Z "std" => "Choose a category:",
( G2 ~" ~ z" _, s "options" => $wp_getcat),$ N5 T7 m1 r! [5 T2 G( b
( ~5 N, ?$ x9 |+ u4 S
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",# [' V$ @+ L2 i! r- C
"id" => $shortname."_featured_number3",
' H( _* e) O* m ^* O "type" => "select",. ~: Z( U% x$ n ~; q: W
"std" => "Number of post:",
& X9 ~! {0 X; [" }0 Z "options" => $number_entries),/ H7 n% l4 d# U/ u
; E6 }. U3 U: v. X, |' X" _
: r8 E/ y) i# s- t" E7 U% H array( "name" => "</div></div>",
8 }$ m+ ?3 r0 [ "type" => "close",0 i& G& Q! z* w: i! l
),1 W7 _. Y7 z& @9 ]3 j
/ E- \" D8 Q9 m) ^/ m* N9 Q8 }
" y2 D: e) a' Y# d6 T# n, e( N array( "name" => "Google Adsense & Analytics Settings",
N" [+ B' ]2 A7 A1 v "type" => "heading",* W5 Z/ o4 f% f
),) Y4 _$ h4 s* D& K1 g; r
. k6 O. M# b' T) e d
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
4 `5 d) a( d- a- d' M; ^8 E "id" => $shortname."_adsense_loop_activate",
% I" v; h& \, y1 h9 ~ "type" => "select",
: l$ n8 |( N- G9 C9 }: r3 m7 Z0 g4 D "std" => "Disable",
4 r0 s0 K' @* \0 { "options" => array("Disable", "Enable")),! ]% o3 o- E: ]6 c
1 V! @- Z* q* _- }& D array( "name" => "Insert Google Adsense Code For Loops Here<br />6 z- L- q2 G5 ~, Q4 ~. S
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
9 H7 f7 f9 Y; l8 \: `3 L "id" => $shortname."_adsense_loop",
3 a& T8 E# K; w. H' T "type" => "textarea",
5 k ~& `5 Z& M5 D o1 j- r3 ? "std" => "",) Q- u% I! g+ c
), P; C; p4 r8 m" J) m
& l' g1 b( E: p4 i/ M$ B L+ F8 Q: @
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",0 R7 P% E8 x( n8 V/ ^
"id" => $shortname."_adsense_single_activate",
) G: I! Y8 E: Q+ Z3 d. J "type" => "select",
/ d+ z5 v' Q) |5 J! ] "std" => "Disable",5 ]- ~, Z4 M2 Q3 Z2 G) y* W0 ^
"options" => array("Disable", "Enable")),
- Y# g% p* h% Z" J& X* g/ `9 d$ i# Z X
array( "name" => "Insert Google Adsense Code For Single Page Here<br />& _# b- y, }: [/ R1 W5 \
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",' T2 j; K" O( F6 y" L
"id" => $shortname."_adsense_single",* c# l& h" U: e: o/ U$ e) k
"type" => "textarea",3 w4 ^6 J5 [. `' a
"std" => "",, E6 j: K$ u4 e( l0 T
),
; O B" j7 ?" s( `5 F/ \/ t1 _ o" N* a% h( K2 p" s3 \
( y$ x0 x; H8 ^# U# e7 F( a" m array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
3 U8 O* `2 y0 c6 l# y( u# T "id" => $shortname."_google_analytics",# b. t! j2 B1 G0 w: S% T
"type" => "textarea",# K/ ~& k" ]% k7 y2 D$ Z- m/ r+ I
"std" => "",
+ |& C4 P6 w! Z. i ),
4 }( \- v, X& U4 T' i8 R% A+ o0 U5 L0 a7 u
array( "name" => "</div></div>",
! z+ V$ M) r; W5 u "type" => "close",; W( I& J- k; }4 D) a; G
),
$ g7 C, R# h1 a0 j$ t, Z6 c4 h $ B' W4 S# V% T( r
! V/ L' |$ o8 P. M% _
array( "name" => "AddThis Social Bookmarking Settings",, ?, U2 r+ @0 m! Q. v1 f- N/ N- Y- {$ b
"type" => "heading",
, Z) N7 }) O5 X* a- q/ j. [, b& i/ ~ ),% X5 M1 \4 ?' q" x) R0 H+ G, ]+ o; ]; ^
4 |6 b I: }8 `! Z9 w6 p* h$ d
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
$ b; i/ P9 v; m1 J <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",* ~7 l' y! i; q0 O: [ f
"id" => $shortname."_addthis",
* C) _. ^1 k* I0 c' {* ]4 } "type" => "text",
; L& y# n- N: U# t" }$ G4 { "box" => "social",
0 y8 a0 G* J3 L; ^ "std" => "", U% s. J4 ]1 ~! I9 [! |
),( ~& @( @: E$ y p! B0 t S" p
R1 `- O, C# p array( "name" => "</div></div>",
$ q1 ^; f5 v* m# [- R "type" => "close",! q1 `' h# K8 n/ u
),
, n; }& R6 l: k/ K b' x
% z: n8 l2 y8 |6 l6 Q, g# h . K' ]( m+ z9 S" O3 }# e: x
- a, [ t2 I$ o7 P1 F$ A7 ~
array( "name" => "YouTube Video Settings",
; n$ b7 W8 G+ B5 M6 z# j5 R: O "type" => "heading",
6 }% ~3 g9 Y9 F) @, X ),4 _; `5 S2 ], i( W- p! L6 C
' {! }* G- R; q/ [9 ?% I$ u" ] array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% u, }* s. _* {; ?9 s
"id" => $shortname."_emvideo_activate",
7 u- G! ~) C% P4 g) p "type" => "select",
1 t1 c \; A3 ^0 t4 \0 ^ "std" => "No",
2 Z) n& S: N4 l6 \& H1 p* ? "options" => array("No", "Yes")),
0 p! a- l1 S+ F* }3 F5 ?& \# v/ a) ?7 I# j- |
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>",
! K) E8 s" W8 X8 p/ M "id" => $shortname."_emvideo",3 P2 L, `# }8 i& \
"std" => "",: W7 D* L. a; J& e
"type" => "text"),
/ o5 S! K6 S8 `! t' _( d7 q o* C5 }" W% t( r
array( "name" => "</div></div>",
6 X3 [. J/ t3 P8 t J1 U: Q- H7 H K+ N "type" => "close",
( `6 W9 B* ^; a6 E ),5 M# d* i. |# `7 u1 C/ u
8 I' B8 Q; c( Q8 J array( "name" => "Twitter Settings",
5 p. T. V0 B' e "type" => "heading"," b5 H* a; |1 u
), W' ]3 d3 j" \ G
9 l: `, m8 G/ O4 n6 \ array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 I# b) H0 j; m3 H x2 _ "id" => $shortname."_twitter_activate",2 X8 G# ]; r+ Q& g( A0 ]; Q) q
"type" => "select",
4 F) r. P% \; B$ B0 G% ~! i "std" => "No",
$ B N/ w2 k( S/ D+ z4 s "options" => array("No", "Yes")),
0 @7 \- J* p/ m7 U T z/ E: D) i" s' p6 H6 ~
array( "name" => "Insert Your Twitter ID here2 e9 X3 d( m B% s! I
<br /><em>*leave blank if not necessary</em>
5 ]7 s& r* m5 _7 O Q# w <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",5 }: s4 _% M. t9 Y& ?7 M
"id" => $shortname."_twitter",
4 N" i% w/ ?3 B' V w" J2 t9 s "type" => "text",
0 A8 A& }2 |6 Y S( c1 o5 c; E "box" => "social"," l' e9 T/ o* [$ f2 C% Z/ c
"std" => "",
% w) y4 d1 w6 c* } ),. L4 H3 c1 Q* y5 U9 L. h
9 P7 m; i# t- f I( |2 X
array( "name" => "Enter Twitter Feed Count here- B1 X& M5 e. m1 W) a) x$ W3 r! W
<br /><em>*leave blank if not necessary</em>2 }8 p* S$ w- e0 L8 [+ E
<br /><em>*Enter How Many Twitter Feed To Display</em>",
% y8 C/ W' F6 E; m8 U "id" => $shortname."_twitter_count",+ j9 u3 [, B- b" z
"type" => "text",+ s6 h: s/ R0 {9 T
"box" => "social",
8 K2 l! C4 n, x5 C, A "std" => "",) Z/ b) l0 _" J* K; s% O3 e: |
),
6 Z. e" f3 q" C0 n4 v s5 U4 C
$ V* j! j b: o) L2 T" l9 i array( "name" => "</div></div>",
1 n% l! z1 d1 \& e5 j; I; Q q "type" => "close",
! t: _: E* z$ w, {5 @3 x ),: u9 p; I$ U) L1 \1 @
$ n D4 E& s$ @* m* k! I( r
4 u8 v0 h, J, A7 u# h array( "name" => "125 x 125 Banners Advertisement Settings",! _# ^0 J3 z- I% u8 K4 t5 p) ~1 [
"type" => "heading",
! w: \, k/ G2 K4 ~& o3 j, w$ z6 O ),
4 v8 r& {2 v7 L! W1 L
/ Y" D; W M9 P( w array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: R, L8 ~( }7 y4 U/ ?- ^! i9 y
"id" => $shortname."_sponsor_activate",% w: c1 H ?& P: Q& F0 F+ m4 G3 Q
"type" => "select",
3 L9 u4 x& \7 r3 `; T "std" => "No",
$ z2 \* ]! F2 V) d. |# b "options" => array("No", "Yes")),
, Z l) m8 A, }2 i0 G 0 K& K# V7 j8 n' j2 w
: n1 @% X- M/ K& H5 u. r' J) T array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",9 Y f: R) d$ x* P7 L) j6 n$ A
"id" => $shortname."_sponsor_banner_one",2 H. a/ l+ e8 S. R& B
"type" => "textarea",
9 g1 o% N8 E- e# \# u' ~ "std" => "",- O: ^: Z- K$ [; [6 Q
),
* v6 k% j! u2 a8 M/ h+ s9 Q: c
3 T0 s( p0 ~8 c7 {0 x7 T; Y array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",& Z0 ]: ?% N, X
"id" => $shortname."_sponsor_banner_two",
1 ?7 t- T* _; U, r7 l "type" => "textarea",: y5 c8 l- l# x
"std" => "",4 ]/ U' n* N. J' P" s3 J* w
),% y- P+ {* W$ e1 C* Q- k( Y
6 k4 e* ]5 l. z% v {2 J* k array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",4 @6 p0 ^+ q2 T# @9 h# \) m
"id" => $shortname."_sponsor_banner_three",0 F* H! G& a: T8 I8 G6 G4 M
"type" => "textarea",( P; e3 |# {1 M4 `1 p. Y( L
"std" => "",, b6 Y& c) l/ I1 S+ z, _
),
/ e* L7 h; k- e6 P9 p) u( c" A( ?- D7 g* C; ~' y
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",) b8 {4 Z( m- Y. @0 z
"id" => $shortname."_sponsor_banner_four",8 i* _& v! `; P, i
"type" => "textarea",0 g7 j6 b6 A+ a% E
"std" => "",- b8 f2 F5 U& B! p
),
* R4 `1 T- Y* R6 ?1 c9 E& O" U6 X1 H" i! v
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
, d( u R" V' | "id" => $shortname."_sponsor_banner_five",
( g9 c# A) `4 S% \# e5 D "type" => "textarea",0 j& f0 R$ ~' V! v3 R6 O/ X# U; H
"std" => "",$ c% D& e7 o6 I \- }1 Y. Q
),
& _5 d) J2 G' G# J
! I# y8 ]+ ^6 q; c, {6 W array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
" S2 Q5 {# \. a# U! p5 ~; n% H, w6 L7 R "id" => $shortname."_sponsor_banner_six",! Z7 d5 m+ Y" \, t
"type" => "textarea",
* y; z: X% ]1 C* t/ U "std" => "",
* Y) G/ {' |/ i) _ ),; Q, \/ ] \5 E) G1 o( X
% ^9 k, R8 c- A, u8 K# Y
array( "name" => "</div></div>",! H; m( a7 e7 O7 Y( A
"type" => "close",7 x9 l. c7 U( n! Q9 S
),
2 |1 @9 `5 x& S' M9 N" C7 T2 ^
' N& A& W B2 |+ h& [) U" h, t [. C' Y2 s3 w$ G1 X4 n% g% ~
# A$ R* D; S( A) t0 E);
4 O! `. h" o' w p% d8 z p/ B! D- M3 ^# g
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
! X& o/ T$ Y) w- i. A, Q# D9 b+ W# _. f
echo "<div id=\"admin-options\"> ";! p" X( h9 C L) M
! d8 v% d; c7 Q. E
global $themename, $shortname, $options;
" ~) G" M, m6 Pif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
) c0 B) c# }* p5 u, N- U' Qif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
6 [- D s: s2 s2 w' O; X8 \?>2 ?+ e: T' D& G1 Q
! ~0 B K/ q* A1 N7 p1 _<h4><?php echo "$themename"; ?> Theme Options</h4>
3 U/ }( i4 m) G' }1 s( P; m; s
# g& \9 }/ \$ a8 v* J<div class="annouce">1 ^ K& C6 f. x+ E' w; {6 p6 H$ G
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
( t$ n x9 W: G( c& x4 s' q! F<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>: Z6 J' Q9 G4 ~ L) o# k
</div>/ M# c' ], {" N+ ~ q
: n+ |: P" g# ~# j" s
<form action="" method="post">' O$ }+ V A+ C6 Y9 ?# s6 B
, ]9 I+ X) x! |& G) Y: j' B& k
<?php foreach ($options as $value) { ?>
/ J: A! O0 W y! i' t
: o0 _7 W: n# j# ]* X- g<?php switch ( $value['type'] ) { case 'heading': ?>
, R! S% F) b R) {- J$ E; |# _/ L% ?5 i5 T1 |6 W5 k
<div class="get-option"> b5 ^/ N7 [, [3 y% n
; A1 D# G* _) T4 E& e. F9 A& w
<h2><?php echo $value['name']; ?></h2>+ Z, W6 A8 H; A2 z) g: O
! i- L; _; x8 Q+ o<div class="option-save">
8 d% I; }3 c \2 ]. k- ~
% _9 P( F6 [; J, e<?php
! @! b' w2 g; Z* L, t6 wbreak;
( `4 f- H- y5 |( xcase 'text':
/ M+ j1 C0 D& d; y. b/ h7 g?>
p5 N. D+ x5 i, q2 u1 n$ p
3 f r7 o$ o- v1 b<div class="description"><?php echo $value['name']; ?></div>
: @8 G6 f% Y, ^! f% M<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (2 X3 n3 e7 \; n/ r
! Z9 f& X1 J& |8 S$ R6 m" C& ^3 p% wget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
& `8 C5 @# l- V2 [3 M4 g& p* G4 l$ U( D" b" N
<?php( n" H1 H2 {% H0 j+ I# K K8 J
break;
) M+ y2 o! I1 w5 u; m9 _ y7 \case 'select':: q/ N' W) N u/ m' j+ f
?>
& b/ i5 T' o# [8 k: A
+ y* E: C* } e0 S9 t4 u<div class="description"><?php echo $value['name']; ?></div>
4 E( b9 i/ j5 K2 c( z: d<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
7 y4 @ C c& Q' Z. T E7 y<?php foreach ($value['options'] as $option) { ?>
9 b6 i5 P% s8 N% f<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
3 I5 x$ Z+ p9 k' p% }9 E<?php } ?>
0 r" i- i3 y9 w$ K! d</select>
0 b9 U7 `; |& \* K- u</p>
7 a8 y0 q4 I" I, d6 B4 M/ {/ H+ P# s: ~% K1 S$ l4 K- P- r) O
<?php
" B* n/ V' P* P6 W! mbreak;: M, w Z4 E. g+ o
case 'textarea':( B2 \( X7 h7 X! A. Z$ f# o
$valuex = $value['id'];0 l) G# ^' I% t1 C, u
$valuey = stripslashes($valuex);
' l, O& b9 T1 Z: N/ l2 S/ H; h$video_code = get_settings($valuey);" i k! _* y: u3 P, R* @& c
?>& d; g7 [6 S4 v8 N
8 I* {7 Q( i' D/ V g
<div class="description"><?php echo $value['name']; ?></div>
0 p {" _ ?3 L( L<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
0 A& c0 @$ Z9 X# j a8 D
( u0 z& l- O# Pelse { echo $value['std']; } ?></textarea></p> `2 ?$ O d$ E: k/ H2 c; `8 L
g2 x/ q0 [( N8 y/ n
<?php' h- n" f7 e/ x; ~
break;
6 B% x1 ~) f, R: a- |; @$ zcase 'close':. ^* N2 @7 u8 v" s
?>6 d% F" J7 ]1 Y* n
" M0 z9 L* q; o8 l1 |. P" V<div class="clearfix"></div>: W& I$ J. u3 O( J2 V4 T* G a
</div><!-- OPTION SAVE END -->! X/ |" A' c8 \# q3 c
& W% ~5 ~3 S: k( P# F; ?<div class="clearfix"></div>
" o4 y2 S# c: Z+ P4 a; n</div><!-- GET OPTION END -->3 u! ~: G$ }( \. l- T- l& V5 o
% h4 O# }! {6 M, y& F/ I
<?php% E( ^) [2 z% p: Y
break;
, s! ?7 e+ r# D8 z5 ldefault;
: e- e0 m8 Q b1 q5 J3 G?>; s: S+ S# I$ Z3 w& T
7 S, |! ^4 z: |
@6 r8 a7 X: i/ u4 L/ [
<?php( o2 N$ x$ @% @
break; } ?>) A; ]; q, ?1 k- c( Y3 c! C* J- L$ n0 q
* s/ s- L& V/ r& `<?php } ?>4 E, n3 m! w7 b8 H" ^
& B3 M3 ?0 F6 M6 q1 `) }$ d6 {. R<p class="save-p">
. D" u5 s( b/ F6 S' n4 P<input name="save" type="submit" class="sbutton" value="Save Options" />
, M5 M% @7 W; v; U7 p1 N# M! {<input type="hidden" name="action" value="save" />
9 X+ m5 T* \/ K, J</p>
* t8 U% D8 ?' j% y A% ?2 h</form>6 t# ]' k% b- K: g8 ?
, Z) ^6 E/ x+ ~- I$ A2 W. m x& C
<form method="post">* B; m) i! c6 E' `0 ^
<p class="save-p">
, D4 O, C, q, h+ U0 u<input name="reset" type="submit" class="sbutton" value="Reset Options" />
: ]- b# P( Q3 \4 u- k1 p, [! w) e* g<input type="hidden" name="action" value="reset" />
( C. \! c" Z; ~6 \' K3 F</p>8 |/ t% x9 Q0 E4 u3 a7 t+ _/ l
</form>
; O; @. k7 L% }6 f0 _
& p* G5 y6 o+ A6 V& \</div><!-- ADMIN OPTIONS END -->
; a1 P2 ^8 _3 U$ e2 ^+ Y; u' S- j/ X& R5 }1 k' b
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
! a" [- k: i. D) Q) R" }* h- a- u: w, Y+ u, D: f
function mytheme_admin_register() {8 k3 V* T% ?8 O' |$ K0 V
global $themename, $shortname, $options;2 \ m: F, ]: s% i5 O
if ( $_GET['page'] == basename(__FILE__) ) {
. K% C# Q$ ~6 f# |) F4 Cif ( 'save' == $_REQUEST['action'] ) {% @1 Z) S: L6 q$ z: `3 k4 ~) b2 P7 K
foreach ($options as $value) {* H7 k5 A7 n0 N# a
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
, \6 u& i) b; d+ Lforeach ($options as $value) {
4 e. j8 }6 w2 b, ~8 `* Eif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }2 J0 z0 k# H, B
header("Location: themes.php?page=functions.php&saved=true");
% k$ J3 _4 F5 @# t" fdie;
4 P# b" a. R+ y9 \9 Y A" X) `4 [} else if( 'reset' == $_REQUEST['action'] ) {: i$ k7 I( c3 q1 g
foreach ($options as $value) {
+ U2 J- O/ \9 G; Y( ]3 k% pdelete_option( $value['id'] ); }! F6 N Z' w+ v$ s
header("Location: themes.php?page=functions.php&reset=true");5 B' x1 g6 m% C
die;# O" E3 z" R9 f8 B
}
) x; j: H: r' _% G6 g- a, ^9 C+ c}7 w H$ @! I( ~3 g9 K
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
# S# \- I( v* A: D3 i}
: F- }& d$ c; `: ]$ t' O; T
% a& X0 t; n* @! J7 |6 Y2 @+ Bfunction mytheme_admin_head() { ?> G. {, K; d' z; N- ~7 A( n& c
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
- O9 @ C8 E* a9 |$ Z3 I0 ~/ t<?php }& n Z- d. z+ m+ @" P: W+ z
|
|