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