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