|
|

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