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