|
|

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