|
|

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