|
|

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