|
|

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