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