|
|

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