|
|

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