|

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