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